Car Game
现在我们来玩一个游戏,游戏有四个键,分别是help,start(开车)和stop(停车)以及quit(关闭该游戏),设计该游戏,注意:要够简洁,够人性化!
started=False
while True:
command=input("> ")
if command=="help":
print("""
start-car to start
stop-car to stop
quit-quit to
""")
elif command=="start":
if started:
print("Car has already started")
else:
started=True
print("car start")
elif command=="stop":
if not started:
print("Car has already stopped")
else:
started=False
print("car stop")
elif command=="quit":
break
else:
print("I don't understand you")