<p>基本上,你可以把你的问题放在一个循环中,反复循环,直到你输入一个想要的“如果”案例。我修改了你的代码如下。请看一看</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.")
while True:
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. ")
break
if str in ("l"):
print("The forest trees grow thicker and darker that way. You stare into the shadows and feel... cold...")
break
if str in ("r"):
print("The forest is warm and inviting that way, you think you can hear a distant birds chirp.")
break
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.")
break
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.")
break
else:
print("Try that again")
</code></pre>