-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrapMoveTest.py
More file actions
40 lines (38 loc) · 1.32 KB
/
trapMoveTest.py
File metadata and controls
40 lines (38 loc) · 1.32 KB
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
#trapMoveTest.py
"""def get_trap_lines(self):
traps_lines = (
((1,0),(1,1),(1,2),(1,3),(1,4),(1,5),(1,6)),
((5,0),(5,1),(5,2),(5,3),(5,4),(5,5),(5,6)),
((0,1),(1,1),(2,1),(3,1),(4,1),(5,1),(6,1)),
((0,5),(1,5),(2,5),(3,5),(4,5),(5,5),(6,5)),
((2,0),(2,1),(2,2),(2,3),(2,4),(2,5),(2,6)),
((4,0),(4,1),(4,2),(4,3),(4,4),(4,5),(4,6)),
((0,2),(1,2),(2,2),(3,2),(4,2),(5,2),(6,2)),
((0,4),(1,4),(2,4),(3,4),(4,4),(5,4),(6,4))
)
return traps_lines
"""
def get_trappable_positions():
trappable_positions = (
((0,0),(0,1),(0,2),(0,3),(0,4),(0,5),(0,6)),
((6,0),(6,1),(6,2),(6,3),(6,4),(6,5),(6,6)),
((0,0),(1,0),(2,0),(3,0),(4,0),(5,0),(6,0)),
((0,6),(1,6),(2,6),(3,6),(4,6),(5,6),(6,6)),
((1,0),(1,1),(1,2),(1,3),(1,4),(1,5),(1,6)),
((5,0),(5,1),(5,2),(5,3),(5,4),(5,5),(5,6)),
((0,1),(1,1),(2,1),(3,1),(4,1),(5,1),(6,1)),
((0,5),(1,5),(2,5),(3,5),(4,5),(5,5),(6,5))
)
return trappable_positions
opp_pos = (3,5)
line_index = 0
found_in_trappable_positions = False
for line in get_trappable_positions():
if opp_pos in line:
print("Found opp_pos in line " + str(line_index))
found_in_trappable_positions = True
break
else:
line_index += 1
print("max of 1 or 2:" + str(max(1,2)))
print("Done")