neuer commit 31.3.2023 19:46
This commit is contained in:
parent
218a4e7b0a
commit
5719bb8641
11
main.py
11
main.py
@ -7,8 +7,7 @@ system('clear')
|
||||
|
||||
|
||||
def cube():
|
||||
entry = 99
|
||||
while entry != 2:
|
||||
while True:
|
||||
try:
|
||||
print('\x1b[H\x1b[1;14H ', cube_)
|
||||
entry = int(input('\x1b[H\x1b[B\x1b[B1 drücken zum Würfeln.\n2 drücken zum beenden.\n'))
|
||||
@ -16,7 +15,7 @@ def cube():
|
||||
if entry == 1:
|
||||
system('clear')
|
||||
print('\x1b[8;12HDu hast eine \x1b[1;33m%d\x1b[1;0m gewürfelt' % random.randint(1, 6))
|
||||
elif entry == 0:
|
||||
elif entry == 0 or entry > 2:
|
||||
print('\n')
|
||||
system('clear')
|
||||
print('\n\n\n\n')
|
||||
@ -27,17 +26,11 @@ def cube():
|
||||
print('Danke für\'s würfeln.\nBis Bald!\n')
|
||||
input('Enter zum schließen.\n')
|
||||
exit()
|
||||
elif entry > 1:
|
||||
print('\n')
|
||||
system('clear')
|
||||
print('\n\n\n\n')
|
||||
print('Ups! Da wurde nicht 1 oder 2 gedrückt.\nBitte nochmal versuchen.\n')
|
||||
except ValueError:
|
||||
print('\n')
|
||||
system('clear')
|
||||
print('\n\n\n\n')
|
||||
print('Ups! Da wurde nicht 1 oder 2 gedrückt.\nBitte nochmal versuchen.\n')
|
||||
print("entry =", entry)
|
||||
|
||||
|
||||
cube()
|
||||
|
Loading…
x
Reference in New Issue
Block a user