develop
Mix 3 years ago
commit 1d0aad14fd

@ -149,7 +149,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): 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 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:
@ -165,7 +165,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] == 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): 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):
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:
@ -189,7 +189,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
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 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] != 17 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):
return 0 return 0
if 8<=MAP[x][y]<=9: if 8<=MAP[x][y]<=9:
if MAP[x][y] == 8: if MAP[x][y] == 8:
@ -209,7 +209,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
return 1 return 1
else: else:
for i in range(y+1,old_y): for i in range(y+1,old_y):
if (MAP[x][i] != 0 and MAP[x][i] != 20 and MAP[x][i] != 15 and MAP[x][i] != 17 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 ):
return 0 return 0
if 8<=MAP[x][y]<=9: if 8<=MAP[x][y]<=9:
if MAP[x][y] == 8: if MAP[x][y] == 8:
@ -230,7 +230,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
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 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] != 17 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):
return 0 return 0
if 8<=MAP[x][y]<=9: if 8<=MAP[x][y]<=9:
if MAP[x][y] == 8: if MAP[x][y] == 8:
@ -250,7 +250,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
return 1 return 1
else : else :
for i in range(x+1,old_x): for i in range(x+1,old_x):
if (MAP[i][y] != 0 and MAP[i][y] != 20 and MAP[i][y] != 15 and MAP[i][y] != 17 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):
return 0 return 0
if 8<=MAP[x][y]<=9: if 8<=MAP[x][y]<=9:
if MAP[x][y] == 8: if MAP[x][y] == 8:
@ -538,7 +538,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): 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 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
@ -555,7 +555,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): 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):
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
@ -580,7 +580,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
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 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[i][y] != 15 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):
return 0 return 0
if 1 <= MAP[x][y] <= 2: if 1 <= MAP[x][y] <= 2:
if MAP[x][y] == 1: if MAP[x][y] == 1:
@ -600,7 +600,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
return 1 return 1
else: else:
for i in range(y + 1, old_y): for i in range(y + 1, old_y):
if (MAP[x][i] != 0 and MAP[x][i] != 20 and MAP[x][i] != 17 and MAP[i][y] != 15 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):
return 0 return 0
if 1 <= MAP[x][y] <= 2: if 1 <= MAP[x][y] <= 2:
if MAP[x][y] == 1: if MAP[x][y] == 1:
@ -621,7 +621,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
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 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] != 15 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):
return 0 return 0
if 1 <= MAP[x][y] <= 2: if 1 <= MAP[x][y] <= 2:
if MAP[x][y] == 1: if MAP[x][y] == 1:
@ -641,7 +641,7 @@ def ismove(old_x,old_y,x,y,id,MAP,MAP1):
return 1 return 1
else: else:
for i in range(x + 1, old_x): for i in range(x + 1, old_x):
if (MAP[i][y] != 0 and MAP[i][y] != 20 and MAP[i][y] != 17 and MAP[i][y] != 15 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):
return 0 return 0
if 1 <= MAP[x][y] <= 2: if 1 <= MAP[x][y] <= 2:
if MAP[x][y] == 1: if MAP[x][y] == 1:
@ -962,7 +962,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): 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 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
@ -973,7 +973,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): 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):
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
@ -992,7 +992,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
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 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[i][y] != 15 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):
return 0 return 0
if 1 <= MAP[x][y] <= 2: if 1 <= MAP[x][y] <= 2:
if MAP[x][y] == 1: if MAP[x][y] == 1:
@ -1006,7 +1006,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
return 1 return 1
else: else:
for i in range(y + 1, old_y): for i in range(y + 1, old_y):
if (MAP[x][i] != 0 and MAP[x][i] != 20 and MAP[x][i] != 17 and MAP[i][y] != 15 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):
return 0 return 0
if 1 <= MAP[x][y] <= 2: if 1 <= MAP[x][y] <= 2:
if MAP[x][y] == 1: if MAP[x][y] == 1:
@ -1021,7 +1021,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
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 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] != 15 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):
return 0 return 0
if 1 <= MAP[x][y] <= 2: if 1 <= MAP[x][y] <= 2:
if MAP[x][y] == 1: if MAP[x][y] == 1:
@ -1035,7 +1035,7 @@ def left_move(old_x,old_y,x,y,id,MAP,MAP1):
return 1 return 1
else: else:
for i in range(x + 1, old_x): for i in range(x + 1, old_x):
if (MAP[i][y] != 0 and MAP[i][y] != 20 and MAP[i][y] != 17 and MAP[i][y] != 15 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):
return 0 return 0
if 1 <= MAP[x][y] <= 2: if 1 <= MAP[x][y] <= 2:
if MAP[x][y] == 1: if MAP[x][y] == 1:
@ -1279,7 +1279,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): 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 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:
@ -1290,7 +1290,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): 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 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:
@ -1309,7 +1309,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
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 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] != 17 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):
return 0 return 0
if 8 <= MAP[x][y] <= 9: if 8 <= MAP[x][y] <= 9:
if MAP[x][y] == 8: if MAP[x][y] == 8:
@ -1323,7 +1323,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
return 1 return 1
else: else:
for i in range(y + 1, old_y): for i in range(y + 1, old_y):
if (MAP[x][i] != 0 and MAP[x][i] != 20 and MAP[x][i] != 15 and MAP[x][i] != 17 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):
return 0 return 0
if 8 <= MAP[x][y] <= 9: if 8 <= MAP[x][y] <= 9:
if MAP[x][y] == 8: if MAP[x][y] == 8:
@ -1339,7 +1339,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
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 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] != 17 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):
return 0 return 0
if 8 <= MAP[x][y] <= 9: if 8 <= MAP[x][y] <= 9:
if MAP[x][y] == 8: if MAP[x][y] == 8:
@ -1353,7 +1353,7 @@ def right_move(old_x,old_y,x,y,id,MAP,MAP1):
return 1 return 1
else: else:
for i in range(x + 1, old_x): for i in range(x + 1, old_x):
if (MAP[i][y] != 0 and MAP[i][y] != 20 and MAP[i][y] != 15 and MAP[i][y] != 17 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):
return 0 return 0
if 8 <= MAP[x][y] <= 9: if 8 <= MAP[x][y] <= 9:
if MAP[x][y] == 8: if MAP[x][y] == 8:

Loading…
Cancel
Save