这是我的代码:
rightPath = random.choice(North,East,South,West)
if selectPath == rightPath:
print("You slay the monsterous beast and procceed further into the castle")
print("This is just the start of your dangerous adventure")
else:
print("The Monster attacks leaving you helpless on the floor")
time.sleep(4)
print("You Died")
我想让它从北,东,南,西的列表中选择一个随机方向。
答案 0 :(得分:3)
答案 1 :(得分:1)
这应该做到(您只需用输入内容替换selectPath
:
rightPath = random.choice(['North','East','South','West'])
selectPath = 'North'
if selectPath == rightPath:
print("You slay the monsterous beast and procceed further into the castle")
print("This is just the start of your dangerous adventure")
else:
print("The Monster attacks leaving you helpless on the floor")
time.sleep(4)
print("You Died")