new Quit and Restart functionality
This commit is contained in:
parent
dbba059482
commit
4ae599735f
|
@ -1,5 +1,7 @@
|
||||||
"""clean_input"""
|
"""clean_input"""
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import #main_gamemodule_plz_here
|
||||||
|
|
||||||
#message needs to be a string that is printed for user instruction. options is a list of viable inputs
|
#message needs to be a string that is printed for user instruction. options is a list of viable inputs
|
||||||
def io(message: str, options: list) -> str:
|
def io(message: str, options: list) -> str:
|
||||||
|
@ -13,7 +15,19 @@ def io(message: str, options: list) -> str:
|
||||||
if i in options:
|
if i in options:
|
||||||
return i
|
return i
|
||||||
break
|
break
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print('Noch nicht ganz richtig. Hast du deine Auswahl auch richtig geschrieben?')
|
try:
|
||||||
|
print('Noch nicht ganz richtig. Hast du deine Auswahl auch richtig geschrieben?')
|
||||||
|
|
||||||
|
except(i =='QUIT' or i == 'RESTART'):
|
||||||
|
|
||||||
|
if i == 'QUIT':
|
||||||
|
print("Spiel wird beendet...")
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
if i == 'RESTART':
|
||||||
|
print("Spiel wird neu gestartet...")
|
||||||
|
#main_gamemodule_plz_here.game()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue