以下情况,是不是需要引入一个函数啊 ?

from random import choice
cave_numbers=range (0,20)
unvisited_caves=range(0,20)
visited_caves=[]
caves = setup_caves(cave_numbers)
visit_cave(0)
print_caves()
link_caves()
print_caves()
finish_caves()
wumpus_location=choice(cave_numbers)
player_location=choice(cave_numbers)
while player_location==wumpus_location:
player_location=choice(cave_numbers)
while True:
print_location=(player_location)
new_location=get_next_location()
if new_location is not None:
player_location=new_location
if player_location==wumpus_location:
print 'hahahahahhahha'
break

慕容3067478
浏览 130回答 1
1回答

www说

你确定是setuo_caves而不是 setup_caves is not defined????如果是后者你在setup_caves函数前边加上choice.也就是写成choice.setup_caves如果是前者的话我找不出你说的错误!
打开App,查看更多内容
随时随地看视频慕课网APP