-
Notifications
You must be signed in to change notification settings - Fork 1
/
to_shop.py
86 lines (67 loc) · 2.31 KB
/
to_shop.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
from gets_and_posts import sell_treasure, move
from c_map import c_map
from to_room import to_room
from player import Player
from operations import Operations
import sys
# for api-key
from decouple import config
api_key = config('API_KEY')
player = Player()
operations = Operations()
def to_shop(c_map=c_map):
current_room = operations.init_player()
check_inv = operations.check_status()
<<<<<<< HEAD
<<<<<<< HEAD
#print('CHECK INVENTORY', check_inv['inventory'])
#print(current_room, 'LOOKIE')
#print(current_room['room_id'],current_room['title'],'NOW LOOK')
#print(current_room['exits'], 'NOW LOOK')
cur_room_id = current_room['room_id']
path = to_room(c_map[cur_room_id], 105)
# path = bfs(current room, 1(shop room))
print("path", path)
length_of_path = len(path)
# if current_room['title'] == 'Shop':
# for item in check_inv['inventory']:
# operations.sell(item)
# #print(f"You have {check_inv['gold']} now!")
#else:
for m in path:
# for loop of move in path:
print(m, 'THIS ONE')
#print(current_room['room_id'],current_room['title'],'NOW LOOK')
operations.move(m)
length_of_path -= 1
=======
cur_room_id = current_room['room_id']
path = to_room(c_map[cur_room_id], 1)
length_of_path = len(path)
if current_room['title'] == 'Shop':
for item in check_inv['inventory']:
operations.sell(item)
print(f"You have {check_inv['gold']} now!")
else:
for m in path:
print(m, 'THIS ONE')
print(current_room['room_id'],current_room['title'],'NOW LOOK')
operations.move(m)
length_of_path -= 1
>>>>>>> dcbae83402d926f062a4a0db47151ef93677bf3b
=======
cur_room_id = current_room['room_id']
path = to_room(c_map[cur_room_id], 1)
length_of_path = len(path)
if current_room['title'] == 'Shop':
for item in check_inv['inventory']:
operations.sell(item)
print(f"You have {check_inv['gold']} now!")
else:
for m in path:
print(m, 'THIS ONE')
print(current_room['room_id'],current_room['title'],'NOW LOOK')
operations.move(m)
length_of_path -= 1
>>>>>>> 54e08003b001dfded7d0ddc1b5194855959ce91a
print(to_shop())