所以我的 Python 游戏中的这行代码不起作用:
direction=raw_input("What would you like to do?\n")
它应该让玩家输入命令:北、南、东、西、看、搜索、命令或库存。它提出了这个:
回溯(最近一次通话最后):文件“/Users/khalilismail/Desktop/COMPUTING/Text-based Games/DragonQuest.py”,第 173 行,方向=raw_input("What would you like to do?\n") EOFError : 读取一行时的 EOF
请帮忙
这是围绕此的代码堆栈:while game==on:
while place==town:
direction=raw_input("What would you like to do?\n")
if direction=="west":
if "iron ore" and "wood" and "3 Gold Pieces" in items:
print "The blacksmith greets you, and you tell him that you have the items and money he requires, you also give him the saw to make up for some of the difference, he then forges you a battleaxe and wishes you luck on the rest of your quest"
items.remove ("saw")
items.remove ("3 Gold Pieces")
items.remove ("iron ore")
items.remove ("wood")
items.append ("battleaxe")