from random import choice
cave_numbers = range(1, 21)
ww_location = choice(cave_numbers)
# print('ww_location',ww_location)
player_location = choice(cave_numbers)
# print('player_location',player_location)
while player_location == ww_location:
player_location = choice(cave_numbers)
print 'welcome to hunt the ww'
print 'cave len', len(cave_numbers)
while True:
print"player location", player_location
if (player_location == ww_location-1 or player_location == ww_location+1):
print "ww next player '"
player_input = raw_input(">")
if (not player_input.isdigit() or
int (player_input) not in cave_numbers):
print player_input, "is not a cave"
else:
player_location = int (player_input)
if player_location == ww_location:
print player_location,"you got ww"
break
08-23