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