修复可以吃自己陷阱里的同伴的bug

develop
huangjielun 3 years ago
parent 23bcbedd18
commit f4b4890161

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -25,7 +25,7 @@ Mouse = pygame.mixer.Sound('audio/Mouse.mp3')
#Start = pygame.mixer.Sound('audio/start.mp3') #Start = pygame.mixer.Sound('audio/start.mp3')
Tiger = pygame.mixer.Sound('audio/Tiger.mp3') Tiger = pygame.mixer.Sound('audio/Tiger.mp3')
Wolf = pygame.mixer.Sound('audio/Wolf.mp3') Wolf = pygame.mixer.Sound('audio/Wolf.mp3')
Fox = pygame.mixer.Sound('audio/Fox..mp3') Fox = pygame.mixer.Sound('audio/Fox.mp3')
Eagle = pygame.mixer.Sound('audio/Eagle.mp3') Eagle = pygame.mixer.Sound('audio/Eagle.mp3')
pygame.mixer.music.set_volume(0.5) pygame.mixer.music.set_volume(0.5)
#################################################### ####################################################
@ -142,7 +142,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
if id == 1: if id == 1:
if MAP[x][y] == 16: if MAP[x][y] == 16:
return 0 return 0
if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 20 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP[x][y] == 14 or MAP1[x][y] == 15 or MAP[x][y] == 8): if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 20 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP[x][y] == 14 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14) or MAP[x][y] == 8):
if MAP[x][y] == 14 and MAP1[old_x][old_y] == 20: if MAP[x][y] == 14 and MAP1[old_x][old_y] == 20:
return 0 return 0
if MAP[x][y] == 14 and MAP1[old_x][old_y] != 20: if MAP[x][y] == 14 and MAP1[old_x][old_y] != 20:
@ -157,8 +157,10 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
ID[MAP[x][y]] = 0 ID[MAP[x][y]] = 0
r_animals -= 1 r_animals -= 1
return 1 return 1
if MAP1[x][y] == 15 and not (8 <= MAP[x][y] <= 14):
return 0
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 20 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP[x][y] == 14 or MAP1[x][y] == 15 or MAP[x][y] == 8): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 20 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP[x][y] == 14 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14) or MAP[x][y] == 8):
if MAP[x][y] == 14 and MAP1[old_x][old_y] == 20: if MAP[x][y] == 14 and MAP1[old_x][old_y] == 20:
return 0 return 0
if MAP[x][y] == 14 and MAP1[old_x][old_y] != 20: if MAP[x][y] == 14 and MAP1[old_x][old_y] != 20:
@ -179,7 +181,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
elif id == 2: elif id == 2:
if MAP[x][y] == 16 and MAP[x][y] != 0 and MAP[x][y] != 15 and MAP[x][y] != 17 and MAP[x][y] != 18 and MAP1[x][y] != 15 and (9 < MAP[x][y] <= 14): if MAP[x][y] == 16 and MAP[x][y] != 0 and MAP[x][y] != 15 and MAP[x][y] != 17 and MAP[x][y] != 18 and MAP1[x][y] != 15 and (9 < MAP[x][y] <= 14):
return 0 return 0
if x == old_x and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8<=MAP[x][y]<=9): if x == old_x and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14) or 8<=MAP[x][y]<=9):
if y > old_y: if y > old_y:
for i in range(old_y+1,y): for i in range(old_y+1,y):
if (MAP[x][i] != 0 and MAP[x][i] != 20 and MAP[x][i] != 15 and MAP[x][i] != 16 and MAP[x][i] != 18): if (MAP[x][i] != 0 and MAP[x][i] != 20 and MAP[x][i] != 15 and MAP[x][i] != 16 and MAP[x][i] != 18):
@ -220,7 +222,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
r_animals -= 1 r_animals -= 1
return 1 return 1
return 1 return 1
elif y == old_y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8<=MAP[x][y]<=9): elif y == old_y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14) or 8<=MAP[x][y]<=9):
if x > old_x: if x > old_x:
for i in range(old_x+1,x): for i in range(old_x+1,x):
if (MAP[i][y] != 0 and MAP[i][y] != 20 and MAP[i][y] != 15 and MAP[i][y] != 16 and MAP[i][y] != 18): if (MAP[i][y] != 0 and MAP[i][y] != 20 and MAP[i][y] != 15 and MAP[i][y] != 16 and MAP[i][y] != 18):
@ -264,7 +266,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
else : else :
return 0 return 0
elif id == 3: elif id == 3:
if abs(x - old_x) <= 1 and abs(y - old_y) <= 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8<=MAP[x][y]<=10): if abs(x - old_x) <= 1 and abs(y - old_y) <= 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14) or 8<=MAP[x][y]<=10):
if 8 <= MAP[x][y] <= 10: if 8 <= MAP[x][y] <= 10:
if MAP[x][y] == 8: if MAP[x][y] == 8:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -287,7 +289,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
return 0 return 0
if(MAP[x][y] == 20): if(MAP[x][y] == 20):
return 0 return 0
if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8<=MAP[x][y]<=11): if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14) or 8<=MAP[x][y]<=11):
if 8 <= MAP[x][y] <= 11: if 8 <= MAP[x][y] <= 11:
if MAP[x][y] == 8: if MAP[x][y] == 8:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -304,7 +306,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
r_animals -= 1 r_animals -= 1
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8<=MAP[x][y]<=11): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14) or 8<=MAP[x][y]<=11):
if 8 <= MAP[x][y] <= 11: if 8 <= MAP[x][y] <= 11:
if MAP[x][y] == 8: if MAP[x][y] == 8:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -328,7 +330,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
return 0 return 0
if(MAP[x][y] == 20): if(MAP[x][y] == 20):
return 0 return 0
if abs(x - old_x) ==1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8<=MAP[x][y]<=12): if abs(x - old_x) ==1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14) or 8<=MAP[x][y]<=12):
if 8 <= MAP[x][y] <= 12: if 8 <= MAP[x][y] <= 12:
if MAP[x][y] == 8: if MAP[x][y] == 8:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -345,7 +347,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
r_animals -= 1 r_animals -= 1
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8<=MAP[x][y]<=12): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14) or 8<=MAP[x][y]<=12):
if 8 <= MAP[x][y] <= 12 : if 8 <= MAP[x][y] <= 12 :
if MAP[x][y] == 8: if MAP[x][y] == 8:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -369,7 +371,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
return 0 return 0
if MAP[x][y] == 20: if MAP[x][y] == 20:
return 0 return 0
if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8<=MAP[x][y]<=13): if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14) or 8<=MAP[x][y]<=13):
if 8 <= MAP[x][y] <= 13: if 8 <= MAP[x][y] <= 13:
if MAP[x][y] == 8: if MAP[x][y] == 8:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -386,7 +388,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
r_animals -= 1 r_animals -= 1
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8<=MAP[x][y]<=13): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14) or 8<=MAP[x][y]<=13):
if 8 <= MAP[x][y] <= 13: if 8 <= MAP[x][y] <= 13:
if MAP[x][y] == 8: if MAP[x][y] == 8:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -403,7 +405,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
r_animals -= 1 r_animals -= 1
return 1 return 1
return 1 return 1
elif old_x == x and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8<=MAP[x][y]<=13): elif old_x == x and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14) or 8<=MAP[x][y]<=13):
if y > old_y: if y > old_y:
for i in range(old_y+1,y): for i in range(old_y+1,y):
if MAP[x][i] != 20 and MAP[x][i] != 1 : if MAP[x][i] != 20 and MAP[x][i] != 1 :
@ -444,7 +446,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
r_animals -= 1 r_animals -= 1
return 1 return 1
return 1 return 1
elif old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8<=MAP[x][y]<=13): elif old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14) or 8<=MAP[x][y]<=13):
if x > old_x: if x > old_x:
for i in range(old_x+1,x): for i in range(old_x+1,x):
if MAP[i][y] != 20 and MAP[i][y] != 1 : if MAP[i][y] != 20 and MAP[i][y] != 1 :
@ -492,7 +494,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
return 0 return 0
if(MAP[x][y] == 20): if(MAP[x][y] == 20):
return 0 return 0
if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 9<=MAP[x][y]<=14): if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14) or 9<=MAP[x][y]<=14):
if 9 <= MAP[x][y] <= 14: if 9 <= MAP[x][y] <= 14:
if MAP[x][y] == 8: if MAP[x][y] == 8:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -509,7 +511,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
r_animals -= 1 r_animals -= 1
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 and MAP[x][y] == 18 or MAP1[x][y] == 15 or 9<=MAP[x][y]<=14): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 and MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14) or 9<=MAP[x][y]<=14):
if 9 <= MAP[x][y] <= 14: if 9 <= MAP[x][y] <= 14:
if MAP[x][y] == 8: if MAP[x][y] == 8:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -531,7 +533,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
elif id == 8: elif id == 8:
if MAP[x][y] == 18: if MAP[x][y] == 18:
return 0 return 0
if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 20 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP[x][y] == 7 or MAP1[x][y] == 17 or MAP[x][y] == 1): if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 20 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP[x][y] == 7 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or MAP[x][y] == 1):
if MAP[x][y] == 7: if MAP[x][y] == 7:
if MAP1[old_x][old_y] != 20: if MAP1[old_x][old_y] != 20:
ID[7] = 0 ID[7] = 0
@ -548,7 +550,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
l_animals -= 1 l_animals -= 1
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 20 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP[x][y] == 7 or MAP1[x][y] == 17 or MAP[x][y] == 1): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 20 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP[x][y] == 7 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or MAP[x][y] == 1):
if MAP[x][y] == 7: if MAP[x][y] == 7:
if MAP1[old_x][old_y] != 20: if MAP1[old_x][old_y] != 20:
ID[7] = 0 ID[7] = 0
@ -570,7 +572,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
elif id == 9: elif id == 9:
if MAP[x][y] == 18 and MAP[x][y] != 0 and MAP[x][y] != 15 and MAP[x][y] != 17 and MAP[x][y] != 16 and MAP1[x][y] != 17 and (2<MAP[x][y]<=14): if MAP[x][y] == 18 and MAP[x][y] != 0 and MAP[x][y] != 15 and MAP[x][y] != 17 and MAP[x][y] != 16 and MAP1[x][y] != 17 and (2<MAP[x][y]<=14):
return 0 return 0
if x == old_x and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=2): if x == old_x and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=2):
if y > old_y: if y > old_y:
for i in range(old_y + 1, y): for i in range(old_y + 1, y):
if (MAP[x][i] != 0 and MAP[x][i] != 20 and MAP[x][i] != 17 and MAP[x][i] != 18): if (MAP[x][i] != 0 and MAP[x][i] != 20 and MAP[x][i] != 17 and MAP[x][i] != 18):
@ -611,7 +613,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
l_animals -= 1 l_animals -= 1
return 1 return 1
return 1 return 1
elif y == old_y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=2): elif y == old_y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=2):
if x > old_x: if x > old_x:
for i in range(old_x + 1, x): for i in range(old_x + 1, x):
if (MAP[i][y] != 0 and MAP[i][y] != 20 and MAP[i][y] != 17 and MAP[i][y] != 18): if (MAP[i][y] != 0 and MAP[i][y] != 20 and MAP[i][y] != 17 and MAP[i][y] != 18):
@ -655,7 +657,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
else: else:
return 0 return 0
elif id == 10: elif id == 10:
if abs(x - old_x) <= 1 and abs(y - old_y) <= 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=3): if abs(x - old_x) <= 1 and abs(y - old_y) <= 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=3):
if 1 <= MAP[x][y] <= 3: if 1 <= MAP[x][y] <= 3:
if MAP[x][y] == 1: if MAP[x][y] == 1:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -678,7 +680,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
return 0 return 0
if(MAP[x][y] == 20): if(MAP[x][y] == 20):
return 0 return 0
if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=4): if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=4):
if 1 <= MAP[x][y] <= 4: if 1 <= MAP[x][y] <= 4:
if MAP[x][y] == 1: if MAP[x][y] == 1:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -695,7 +697,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
l_animals -= 1 l_animals -= 1
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=4): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=4):
if 1 <= MAP[x][y] <= 4: if 1 <= MAP[x][y] <= 4:
if MAP[x][y] == 1: if MAP[x][y] == 1:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -719,7 +721,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
return 0 return 0
if(MAP[x][y] == 20): if(MAP[x][y] == 20):
return 0 return 0
if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=5): if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=5):
if 1 <= MAP[x][y] <= 5: if 1 <= MAP[x][y] <= 5:
if MAP[x][y] == 1: if MAP[x][y] == 1:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -736,7 +738,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
l_animals -= 1 l_animals -= 1
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=5): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=5):
if 1 <= MAP[x][y] <= 5: if 1 <= MAP[x][y] <= 5:
if MAP[x][y] == 1: if MAP[x][y] == 1:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -760,7 +762,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
return 0 return 0
if MAP[x][y] == 20: if MAP[x][y] == 20:
return 0 return 0
if abs(x - old_x) ==1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=6): if abs(x - old_x) ==1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=6):
if 1 <= MAP[x][y] <= 6: if 1 <= MAP[x][y] <= 6:
if MAP[x][y] == 1: if MAP[x][y] == 1:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -777,7 +779,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
l_animals -= 1 l_animals -= 1
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=6): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=6):
if 1 <= MAP[x][y] <= 6: if 1 <= MAP[x][y] <= 6:
if MAP[x][y] == 1: if MAP[x][y] == 1:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -794,7 +796,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
l_animals -= 1 l_animals -= 1
return 1 return 1
return 1 return 1
elif old_x == x and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=6): elif old_x == x and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=6):
if y > old_y: if y > old_y:
for i in range(old_y+1,y): for i in range(old_y+1,y):
if MAP[x][i] != 20 and MAP[x][i] != 8 : if MAP[x][i] != 20 and MAP[x][i] != 8 :
@ -835,7 +837,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
l_animals -= 1 l_animals -= 1
return 1 return 1
return 1 return 1
elif old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=6): elif old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=6):
if x > old_x: if x > old_x:
for i in range(old_x+1,x): for i in range(old_x+1,x):
if MAP[i][y] != 20 and MAP[i][y] != 1 : if MAP[i][y] != 20 and MAP[i][y] != 1 :
@ -883,7 +885,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
return 0 return 0
if(MAP[x][y] == 20): if(MAP[x][y] == 20):
return 0 return 0
if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 2<=MAP[x][y]<=7): if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 2<=MAP[x][y]<=7):
if 2 <= MAP[x][y] <= 7: if 2 <= MAP[x][y] <= 7:
if MAP[x][y] == 1: if MAP[x][y] == 1:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -900,7 +902,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
l_animals -= 1 l_animals -= 1
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 2<=MAP[x][y]<=7): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 2<=MAP[x][y]<=7):
if 2 <= MAP[x][y] <= 7: if 2 <= MAP[x][y] <= 7:
if MAP[x][y] == 1: if MAP[x][y] == 1:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -955,7 +957,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
if id == 8: if id == 8:
if MAP[x][y] == 18: if MAP[x][y] == 18:
return 0 return 0
if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 20 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP[x][y] == 7 or MAP1[x][y] == 17 or MAP[x][y] == 1): if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 20 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP[x][y] == 7 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or MAP[x][y] == 1):
if MAP[x][y] == 7: if MAP[x][y] == 7:
if MAP1[old_x][old_y] != 20: if MAP1[old_x][old_y] != 20:
return 1 return 1
@ -966,7 +968,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
if MAP1[x][y] == 17 and 1<=MAP[x][y]<=7: if MAP1[x][y] == 17 and 1<=MAP[x][y]<=7:
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 20 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP[x][y] == 7 or MAP1[x][y] == 17 or MAP[x][y] == 1): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 20 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP[x][y] == 7 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or MAP[x][y] == 1):
if MAP[x][y] == 7: if MAP[x][y] == 7:
if MAP1[old_x][old_y] != 20: if MAP1[old_x][old_y] != 20:
return 1 return 1
@ -982,7 +984,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
elif id == 9: elif id == 9:
if MAP[x][y] == 18 and MAP[x][y] != 0 and MAP[x][y] != 15 and MAP[x][y] != 17 and MAP[x][y] != 16 and MAP1[x][y] != 17 and (2<MAP[x][y]<=14): if MAP[x][y] == 18 and MAP[x][y] != 0 and MAP[x][y] != 15 and MAP[x][y] != 17 and MAP[x][y] != 16 and MAP1[x][y] != 17 and (2<MAP[x][y]<=14):
return 0 return 0
if x == old_x and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=2): if x == old_x and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=2):
if y > old_y: if y > old_y:
for i in range(old_y + 1, y): for i in range(old_y + 1, y):
if (MAP[x][i] != 0 and MAP[x][i] != 20 and MAP[x][i] != 17 and MAP[x][i] != 18): if (MAP[x][i] != 0 and MAP[x][i] != 20 and MAP[x][i] != 17 and MAP[x][i] != 18):
@ -1011,7 +1013,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
if MAP1[x][y] == 17 and 1<=MAP[x][y]<=7: if MAP1[x][y] == 17 and 1<=MAP[x][y]<=7:
return 1 return 1
return 1 return 1
elif y == old_y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=2): elif y == old_y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=2):
if x > old_x: if x > old_x:
for i in range(old_x + 1, x): for i in range(old_x + 1, x):
if (MAP[i][y] != 0 and MAP[i][y] != 20 and MAP[i][y] != 17 and MAP[i][y] != 18): if (MAP[i][y] != 0 and MAP[i][y] != 20 and MAP[i][y] != 17 and MAP[i][y] != 18):
@ -1043,7 +1045,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
else: else:
return 0 return 0
elif id == 10: elif id == 10:
if abs(x - old_x) <= 1 and abs(y - old_y) <= 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=3): if abs(x - old_x) <= 1 and abs(y - old_y) <= 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=3):
if 1 <= MAP[x][y] <= 3: if 1 <= MAP[x][y] <= 3:
if MAP[x][y] == 1: if MAP[x][y] == 1:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -1060,7 +1062,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
return 0 return 0
if(MAP[x][y] == 20): if(MAP[x][y] == 20):
return 0 return 0
if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=4): if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=4):
if 1 <= MAP[x][y] <= 4: if 1 <= MAP[x][y] <= 4:
if MAP[x][y] == 1: if MAP[x][y] == 1:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -1071,7 +1073,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
if MAP1[x][y] == 17 and 1<=MAP[x][y]<=7: if MAP1[x][y] == 17 and 1<=MAP[x][y]<=7:
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=4): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=4):
if 1 <= MAP[x][y] <= 4: if 1 <= MAP[x][y] <= 4:
if MAP[x][y] == 1: if MAP[x][y] == 1:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -1089,7 +1091,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
return 0 return 0
if(MAP[x][y] == 20): if(MAP[x][y] == 20):
return 0 return 0
if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=5): if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=5):
if 1 <= MAP[x][y] <= 5: if 1 <= MAP[x][y] <= 5:
if MAP[x][y] == 1: if MAP[x][y] == 1:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -1100,7 +1102,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
if MAP1[x][y] == 17 and 1<=MAP[x][y]<=7: if MAP1[x][y] == 17 and 1<=MAP[x][y]<=7:
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=5): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=5):
if 1 <= MAP[x][y] <= 5: if 1 <= MAP[x][y] <= 5:
if MAP[x][y] == 1: if MAP[x][y] == 1:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -1118,7 +1120,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
return 0 return 0
if MAP[x][y] == 20: if MAP[x][y] == 20:
return 0 return 0
if abs(x - old_x) ==1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=6): if abs(x - old_x) ==1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=6):
if 1 <= MAP[x][y] <= 6: if 1 <= MAP[x][y] <= 6:
if MAP[x][y] == 1: if MAP[x][y] == 1:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -1129,7 +1131,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
if MAP1[x][y] == 17 and 1<=MAP[x][y]<=7: if MAP1[x][y] == 17 and 1<=MAP[x][y]<=7:
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=6): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=6):
if 1 <= MAP[x][y] <= 6: if 1 <= MAP[x][y] <= 6:
if MAP[x][y] == 1: if MAP[x][y] == 1:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -1140,7 +1142,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
if MAP1[x][y] == 17 and 1<=MAP[x][y]<=7: if MAP1[x][y] == 17 and 1<=MAP[x][y]<=7:
return 1 return 1
return 1 return 1
elif old_x == x and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=6): elif old_x == x and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=6):
if y > old_y: if y > old_y:
for i in range(old_y+1,y): for i in range(old_y+1,y):
if MAP[x][i] != 20 and MAP[x][i] != 8 : if MAP[x][i] != 20 and MAP[x][i] != 8 :
@ -1169,7 +1171,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
if MAP1[x][y] == 17 and 1<=MAP[x][y]<=7: if MAP1[x][y] == 17 and 1<=MAP[x][y]<=7:
return 1 return 1
return 1 return 1
elif old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 1<=MAP[x][y]<=6): elif old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 1<=MAP[x][y]<=6):
if x > old_x: if x > old_x:
for i in range(old_x+1,x): for i in range(old_x+1,x):
if MAP[i][y] != 20 and MAP[i][y] != 1 : if MAP[i][y] != 20 and MAP[i][y] != 1 :
@ -1205,7 +1207,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
return 0 return 0
if(MAP[x][y] == 20): if(MAP[x][y] == 20):
return 0 return 0
if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 2<=MAP[x][y]<=7): if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 2<=MAP[x][y]<=7):
if 2 <= MAP[x][y] <= 7: if 2 <= MAP[x][y] <= 7:
if MAP[x][y] == 1: if MAP[x][y] == 1:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -1216,7 +1218,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
if MAP1[x][y] == 17 and 1<=MAP[x][y]<=7: if MAP1[x][y] == 17 and 1<=MAP[x][y]<=7:
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or MAP1[x][y] == 17 or 2<=MAP[x][y]<=7): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 17 or MAP[x][y] == 15 or MAP[x][y] == 16 or (MAP1[x][y] == 17 and 1<=MAP[x][y]<=7) or 2<=MAP[x][y]<=7):
if 2 <= MAP[x][y] <= 7: if 2 <= MAP[x][y] <= 7:
if MAP[x][y] == 1: if MAP[x][y] == 1:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -1272,7 +1274,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
if MAP[x][y] == 16: if MAP[x][y] == 16:
return 0 return 0
if abs(x - old_x) == 1 and old_y == y and ( if abs(x - old_x) == 1 and old_y == y and (
MAP[x][y] == 0 or MAP[x][y] == 20 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP[x][y] == 14 or MAP1[x][y] == 15 or MAP[x][y] == 8): MAP[x][y] == 0 or MAP[x][y] == 20 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP[x][y] == 14 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14) or MAP[x][y] == 8):
if MAP[x][y] == 14 and MAP1[old_x][old_y] == 20: if MAP[x][y] == 14 and MAP1[old_x][old_y] == 20:
return 0 return 0
if MAP[x][y] == 14 and MAP1[old_x][old_y] != 20: if MAP[x][y] == 14 and MAP1[old_x][old_y] != 20:
@ -1283,7 +1285,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and ( elif old_x == x and abs(y - old_y) == 1 and (
MAP[x][y] == 0 or MAP[x][y] == 20 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP[x][y] == 14 or MAP1[x][y] == 15 or MAP[x][y] == 8): MAP[x][y] == 0 or MAP[x][y] == 20 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP[x][y] == 14 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14)or MAP[x][y] == 8):
if MAP[x][y] == 14 and MAP1[old_x][old_y] == 20: if MAP[x][y] == 14 and MAP1[old_x][old_y] == 20:
return 0 return 0
if MAP[x][y] == 14 and MAP1[old_x][old_y] != 20: if MAP[x][y] == 14 and MAP1[old_x][old_y] != 20:
@ -1299,7 +1301,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
if MAP[x][y] == 16 and MAP[x][y] != 0 and MAP[x][y] != 15 and MAP[x][y] != 17 and MAP[x][y] != 18 and MAP1[x][y] != 15 and (9 < MAP[x][y] <= 14): if MAP[x][y] == 16 and MAP[x][y] != 0 and MAP[x][y] != 15 and MAP[x][y] != 17 and MAP[x][y] != 18 and MAP1[x][y] != 15 and (9 < MAP[x][y] <= 14):
return 0 return 0
if x == old_x and ( if x == old_x and (
MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8 <=MAP[x][y] <= 9): MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14)or 8 <=MAP[x][y] <= 9):
if y > old_y: if y > old_y:
for i in range(old_y + 1, y): for i in range(old_y + 1, y):
if (MAP[x][i] != 0 and MAP[x][i] != 20 and MAP[x][i] != 15 and MAP[x][i] != 16 and MAP[x][i] != 18): if (MAP[x][i] != 0 and MAP[x][i] != 20 and MAP[x][i] != 15 and MAP[x][i] != 16 and MAP[x][i] != 18):
@ -1329,7 +1331,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
return 1 return 1
return 1 return 1
elif y == old_y and ( elif y == old_y and (
MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8 <=MAP[x][y] <= 9): MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14)or 8 <=MAP[x][y] <= 9):
if x > old_x: if x > old_x:
for i in range(old_x + 1, x): for i in range(old_x + 1, x):
if (MAP[i][y] != 0 and MAP[i][y] != 20 and MAP[i][y] != 15 and MAP[i][y] != 16 and MAP[i][y] != 18): if (MAP[i][y] != 0 and MAP[i][y] != 20 and MAP[i][y] != 15 and MAP[i][y] != 16 and MAP[i][y] != 18):
@ -1361,7 +1363,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
else: else:
return 0 return 0
elif id == 3: elif id == 3:
if abs(x - old_x) <= 1 and abs(y - old_y) <= 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8 <=MAP[x][y] <= 10): if abs(x - old_x) <= 1 and abs(y - old_y) <= 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14)or 8 <=MAP[x][y] <= 10):
if 8 <= MAP[x][y] <= 10: if 8 <= MAP[x][y] <= 10:
if MAP[x][y] == 8: if MAP[x][y] == 8:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -1378,7 +1380,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
return 0 return 0
if (MAP[x][y] == 20): if (MAP[x][y] == 20):
return 0 return 0
if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8 <=MAP[x][y] <= 11): if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14)or 8 <=MAP[x][y] <= 11):
if 8 <= MAP[x][y] <= 11: if 8 <= MAP[x][y] <= 11:
if MAP[x][y] == 8: if MAP[x][y] == 8:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -1389,7 +1391,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
if MAP1[x][y] == 15 and 8 <= MAP[x][y] <= 14: if MAP1[x][y] == 15 and 8 <= MAP[x][y] <= 14:
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8 <=MAP[x][y] <= 11): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14)or 8 <=MAP[x][y] <= 11):
if 8 <= MAP[x][y] <= 11: if 8 <= MAP[x][y] <= 11:
if MAP[x][y] == 8: if MAP[x][y] == 8:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -1407,7 +1409,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
return 0 return 0
if (MAP[x][y] == 20): if (MAP[x][y] == 20):
return 0 return 0
if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8 <=MAP[x][y] <= 12): if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14)or 8 <=MAP[x][y] <= 12):
if 8 <= MAP[x][y] <= 12: if 8 <= MAP[x][y] <= 12:
if MAP[x][y] == 8: if MAP[x][y] == 8:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -1418,7 +1420,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
if MAP1[x][y] == 15 and 8 <= MAP[x][y] <= 14: if MAP1[x][y] == 15 and 8 <= MAP[x][y] <= 14:
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8 <=MAP[x][y] <= 12): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14)or 8 <=MAP[x][y] <= 12):
if 8 <= MAP[x][y] <= 12: if 8 <= MAP[x][y] <= 12:
if MAP[x][y] == 8: if MAP[x][y] == 8:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -1436,7 +1438,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
return 0 return 0
if MAP[x][y] == 20: if MAP[x][y] == 20:
return 0 return 0
if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8 <=MAP[x][y] <= 13): if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14)or 8 <=MAP[x][y] <= 13):
if 8 <= MAP[x][y] <= 13: if 8 <= MAP[x][y] <= 13:
if MAP[x][y] == 8: if MAP[x][y] == 8:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -1447,7 +1449,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
if MAP1[x][y] == 15 and 8 <= MAP[x][y] <= 14: if MAP1[x][y] == 15 and 8 <= MAP[x][y] <= 14:
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8 <=MAP[x][y] <= 13): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14)or 8 <=MAP[x][y] <= 13):
if 8 <= MAP[x][y] <= 13: if 8 <= MAP[x][y] <= 13:
if MAP[x][y] == 8: if MAP[x][y] == 8:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -1458,7 +1460,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
if MAP1[x][y] == 15 and 8 <= MAP[x][y] <= 14: if MAP1[x][y] == 15 and 8 <= MAP[x][y] <= 14:
return 1 return 1
return 1 return 1
elif old_x == x and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8 <=MAP[x][y] <= 13): elif old_x == x and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14)or 8 <=MAP[x][y] <= 13):
if y > old_y: if y > old_y:
for i in range(old_y + 1, y): for i in range(old_y + 1, y):
if MAP[x][i] != 20 and MAP[x][i] != 1: if MAP[x][i] != 20 and MAP[x][i] != 1:
@ -1487,7 +1489,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
if MAP1[x][y] == 15 and 8 <= MAP[x][y] <= 14: if MAP1[x][y] == 15 and 8 <= MAP[x][y] <= 14:
return 1 return 1
return 1 return 1
elif old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 8 <=MAP[x][y] <= 13): elif old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14)or 8 <=MAP[x][y] <= 13):
if x > old_x: if x > old_x:
for i in range(old_x + 1, x): for i in range(old_x + 1, x):
if MAP[i][y] != 20 and MAP[i][y] != 1: if MAP[i][y] != 20 and MAP[i][y] != 1:
@ -1523,7 +1525,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
return 0 return 0
if (MAP[x][y] == 20): if (MAP[x][y] == 20):
return 0 return 0
if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or MAP1[x][y] == 15 or 9 <=MAP[x][y] <= 14): if abs(x - old_x) == 1 and old_y == y and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 or MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14)or 9 <=MAP[x][y] <= 14):
if 9 <= MAP[x][y] <= 14: if 9 <= MAP[x][y] <= 14:
if MAP[x][y] == 8: if MAP[x][y] == 8:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:
@ -1534,7 +1536,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
if MAP1[x][y] == 15 and 8 <= MAP[x][y] <= 14: if MAP1[x][y] == 15 and 8 <= MAP[x][y] <= 14:
return 1 return 1
return 1 return 1
elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 and MAP[x][y] == 18 or MAP1[x][y] == 15 or 9 <=MAP[x][y] <= 14): elif old_x == x and abs(y - old_y) == 1 and (MAP[x][y] == 0 or MAP[x][y] == 15 or MAP[x][y] == 17 and MAP[x][y] == 18 or (MAP1[x][y] == 15 and 8<=MAP[x][y]<=14)or 9 <=MAP[x][y] <= 14):
if 9 <= MAP[x][y] <= 14: if 9 <= MAP[x][y] <= 14:
if MAP[x][y] == 8: if MAP[x][y] == 8:
if MAP1[x][y] != 20: if MAP1[x][y] != 20:

Loading…
Cancel
Save