mit Linien zeichnen
This commit is contained in:
parent
e58a5081fb
commit
72834944a0
@ -1,19 +1,53 @@
|
||||
from galgenmaennchen import turtle, t, zeichenliste
|
||||
|
||||
geheimwort = "Dampfmaschienenputzbürste"
|
||||
geheimwort = "und"
|
||||
t.hideturtle()
|
||||
linie = turtle.Pen()
|
||||
linie.hideturtle()
|
||||
|
||||
for buchstabe in geheimwort:
|
||||
linie.fd(15)
|
||||
linie.write(buchstabe, align="center", font="serif 12 bold")
|
||||
linie.fd(15)
|
||||
linie.up()
|
||||
linie.fd(20)
|
||||
linie.down()
|
||||
|
||||
geraten = ""
|
||||
|
||||
def linienzeichnen():
|
||||
linie.home()
|
||||
linie.clear()
|
||||
for buchstabe in geheimwort:
|
||||
linie.fd(15)
|
||||
if buchstabe in geraten:
|
||||
linie.write(buchstabe, align="center", font="serif 12 bold")
|
||||
linie.fd(15)
|
||||
linie.up()
|
||||
linie.fd(20)
|
||||
linie.down()
|
||||
|
||||
linienzeichnen()
|
||||
|
||||
for grafik in zeichenliste:
|
||||
turtle.textinput("", "Welcher Buchstabe?")
|
||||
grafik()
|
||||
gewonnen = "ja"
|
||||
|
||||
neugeraten = turtle.textinput("", "Welcher Buchstabe?")
|
||||
|
||||
while (neugeraten in geheimwort) and (neugeraten not in geraten):
|
||||
geraten = geraten + neugeraten
|
||||
|
||||
gewonnen = "ja"
|
||||
for buchstabe in geheimwort:
|
||||
if buchstabe in geraten:
|
||||
print("drin")
|
||||
pass
|
||||
else:
|
||||
gewonnen = "nein"
|
||||
if gewonnen == "ja":
|
||||
linie.goto(0,-100)
|
||||
linie.write("gewonnen")
|
||||
break
|
||||
print("right")
|
||||
linienzeichnen()
|
||||
neugeraten = turtle.textinput("", "Welcher Buchstabe?")
|
||||
else:
|
||||
geraten = geraten + neugeraten
|
||||
grafik()
|
||||
|
||||
if gewonnen == "ja":
|
||||
linie.goto(0,-100)
|
||||
linie.write("gewonnen")
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user