Format
There really is no hope of making this code even half-way decent without spending the time to rewrite them all properly. Don't want to do any of that
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
|
||||
global mistakes
|
||||
mistakes = 0
|
||||
global wortelements
|
||||
@@ -6,10 +7,11 @@ wortelements = []
|
||||
global done
|
||||
done = []
|
||||
|
||||
|
||||
def clear_screen():
|
||||
os.system('cls')
|
||||
|
||||
|
||||
os.system("cls")
|
||||
|
||||
|
||||
def worteingabe():
|
||||
global wort
|
||||
wort = input("Suchen sie ein Wort, welches erraten werden soll, ein: ")
|
||||
@@ -17,17 +19,21 @@ def worteingabe():
|
||||
print("Vielen Dank. Das Wort wurde gespeichert.")
|
||||
print("Geben Sie das Gerät weiter.")
|
||||
ausgabe(wort)
|
||||
|
||||
|
||||
|
||||
def ausgabe(wort):
|
||||
global wortelements
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
Das Wort:
|
||||
""")
|
||||
print(len(wort)*"*")
|
||||
"""
|
||||
)
|
||||
print(len(wort) * "*")
|
||||
global wholewordlist
|
||||
wholewordlist = list(wort)
|
||||
wortelements = list(len(wort)*"*")
|
||||
wortelements = list(len(wort) * "*")
|
||||
|
||||
|
||||
def ersetzen(letter):
|
||||
global wort
|
||||
@@ -41,15 +47,17 @@ def ersetzen(letter):
|
||||
wortelements.pop(pos)
|
||||
wortelements.insert(pos, letter)
|
||||
|
||||
|
||||
|
||||
def raten():
|
||||
global wort
|
||||
global wortelements
|
||||
global wholewordlist
|
||||
global go
|
||||
global go
|
||||
go = 1
|
||||
while go == 1:
|
||||
buchstabe = input("Suchen sie einen Buchstaben aus, welcher sich im Wort befinden könnte: ")
|
||||
buchstabe = input(
|
||||
"Suchen sie einen Buchstaben aus, welcher sich im Wort befinden könnte: "
|
||||
)
|
||||
if buchstabe in wholewordlist:
|
||||
print("Der Buchstabe kommt hier vor:")
|
||||
ersetzen(buchstabe)
|
||||
@@ -59,7 +67,7 @@ def raten():
|
||||
print("Dieser Buchstabe wurde bereits eingetippt.")
|
||||
addman()
|
||||
elif buchstabe == wort:
|
||||
wholewordlist = list(len(wort)*"*")
|
||||
wholewordlist = list(len(wort) * "*")
|
||||
else:
|
||||
print("Dieser Buchstabe ist nicht Teil des Wortes")
|
||||
done.append(buchstabe)
|
||||
@@ -69,28 +77,33 @@ def raten():
|
||||
if len(wort) - counts <= 0:
|
||||
go = 0
|
||||
else:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
|
||||
DAS WORT WURDE GEFUNDEN
|
||||
Das Wort:
|
||||
""")
|
||||
"""
|
||||
)
|
||||
print(wort)
|
||||
|
||||
|
||||
|
||||
|
||||
def addman():
|
||||
global mistakes
|
||||
mistakes += 1
|
||||
if mistakes == 1:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
|
||||
|
||||
|
||||
__________
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 2:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -98,9 +111,11 @@ def addman():
|
||||
|
||||
|
|
||||
_____|_____
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 3:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -108,9 +123,11 @@ def addman():
|
||||
|
|
||||
|
|
||||
_____|_____
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 4:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
|
||||
|
|
||||
|
|
||||
@@ -118,9 +135,11 @@ def addman():
|
||||
|
|
||||
|\
|
||||
_____|_\___
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 5:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
_____
|
||||
|
|
||||
|
|
||||
@@ -128,9 +147,11 @@ def addman():
|
||||
|
|
||||
|\
|
||||
_____|_\___
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 6:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
_____
|
||||
| |
|
||||
| °
|
||||
@@ -138,9 +159,11 @@ def addman():
|
||||
|
|
||||
|\
|
||||
_____|_\___
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 6:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
_____
|
||||
| |
|
||||
| °
|
||||
@@ -148,9 +171,11 @@ def addman():
|
||||
|
|
||||
|\
|
||||
_____|_\___
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 7:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
_____
|
||||
| |
|
||||
| °
|
||||
@@ -158,9 +183,11 @@ def addman():
|
||||
|
|
||||
|\
|
||||
_____|_\___
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 8:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
_____
|
||||
| |
|
||||
| °
|
||||
@@ -168,9 +195,11 @@ def addman():
|
||||
| /
|
||||
|\
|
||||
_____|_\___
|
||||
""")
|
||||
"""
|
||||
)
|
||||
elif mistakes == 9:
|
||||
print("""
|
||||
print(
|
||||
"""
|
||||
_____
|
||||
| |
|
||||
| °
|
||||
@@ -181,13 +210,11 @@ def addman():
|
||||
|
||||
|
||||
DEAD
|
||||
""")
|
||||
"""
|
||||
)
|
||||
global go
|
||||
go = 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
worteingabe()
|
||||
raten()
|
||||
raten()
|
||||
|
||||
Reference in New Issue
Block a user