forked from georgiana-ojoc/DonkeyKong
-
Notifications
You must be signed in to change notification settings - Fork 0
/
positions.py
27 lines (23 loc) · 813 Bytes
/
positions.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
def get_positions(situation):
with open("positions\\" + situation + ".txt") as file:
content = file.read().split('\n')
coordinates = []
for line in content:
line = line.split()
coordinates += [{'x': int(line[0]), 'y': int(line[1])}]
return coordinates
def get_all_positions():
positions = {}
situation = "ladders"
positions[situation] = get_positions(situation)
situation = "broken_ladders"
positions[situation] = get_positions(situation)
situation = "hammers"
positions[situation] = get_positions(situation)
situation = "start"
positions[situation] = get_positions(situation)
situation = "finish"
positions[situation] = get_positions(situation)
return positions
if __name__ == '__main__':
print(get_all_positions())