<p>我正在用python3.4.3创建一个基于文本的冒险游戏,我不知道如何让代码重复一个问题。如果这有助于理解发生了什么的话,在这之前有一大堆的叙述。你知道吗</p>
<pre><code>print("\n\n\n\n\nYou awake to find yourself in the center of a clearing in a forest.")
print("You stand up and decide to take a look around.")
str = input("Which direction do you steer your head? d= down, l= left, r= right, u= up, b= behind you: ")
print(" ")
if str in ("d"):
print("You see your combat boots and the grassy ground below your feet. ")
if str in ("l"):
print("The forest trees grow thicker and darker that way. You stare into the shadows and feel... cold...")
if str in ("r"):
print("The forest is warm and inviting that way, you think you can hear a distant birds chirp.")
if str in ("u"):
print("The blue sky looks gorgeous, a crow flies overhead... that's not a crow...")
print("It's a Nevermore, an aerial Grim. You stand still until it passes.")
if str in ("b"):
print("the grass slowly grows to dirt as the area falls into a mountain cliff. You now know where you are.")
print("Mount Glenn, one of the most Grim-infested places in all of Remnant.")
print("It's a bit unsettling.")
else:
print("Try that again")
</code></pre>
<p>我希望代码向用户重复这个问题,直到他们回答了所有可能的答案,然后继续下一个问题。我还想让它在他们得到其他东西时重复这个问题。我该怎么做?你知道吗</p>