1
我正在研究一个简单的基于文本的琐事游戏作为我的第一个python项目,并且我的程序一旦达到分数限制就不会终止。当达到分数限制时程序没有终止?
def game(quest_list):
points = 0
score_limit = 20
x, y = info()
time.sleep(2)
if y >= 18 and y < 100:
time.sleep(1)
while points < score_limit:
random.choice(quest_list)(points)
time.sleep(2)
print("Current score:", points, "points")
print("You beat the game!")
quit()
...
'points'永远不会增加,因此循环将永远不会终止 – FujiApple