-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
37 lines (30 loc) · 965 Bytes
/
test.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
def obstacle():
'''
The map is 2D array. The ranges are [0;20] and [-20;-20] horizontally
and [20;-20], [0;-20] vertically.
If the head of the snake (self.snake[0:0]) colides with any of the border, Game ends.
'''
obstacles = []
for i in range(0,21):
point = []
point.append(0)
point.append(i)
obstacles.append(point)
for l in range(1,21):
point = []
point.append(l)
point.append(0)
obstacles.append(point)
for k in range(1,21):
point = []
point.append(20)
point.append(k)
obstacles.append(point)
for x in range(1,20):
point = []
point.append(x)
point.append(20)
obstacles.append(point)
print (obstacles)
if __name__ == "__main__":
obstacle()