Update main2048.py

main
hnu202309010107 6 months ago
parent 2dd848a131
commit f9f83c76f4

@ -122,6 +122,7 @@ def _LEFT():
game_lis[i][k] = 0 game_lis[i][k] = 0
elif game_lis[i][j] == game_lis[i][k]: elif game_lis[i][j] == game_lis[i][k]:
game_lis[i][j] *= 2 game_lis[i][j] *= 2
score+=game_lis[i][j]
game_lis[i][k] = 0 game_lis[i][k] = 0
break break
@ -139,6 +140,7 @@ def _RIGHT():
game_lis[i][k] = 0 game_lis[i][k] = 0
elif game_lis[i][j] == game_lis[i][k]: elif game_lis[i][j] == game_lis[i][k]:
game_lis[i][j] *= 2 game_lis[i][j] *= 2
score+=game_lis[i][j]
game_lis[i][k] = 0 game_lis[i][k] = 0
break break
@ -158,6 +160,7 @@ def _UP():
game_lis[k][i] = 0 game_lis[k][i] = 0
elif game_lis[k][i] == game_lis[j][i]: elif game_lis[k][i] == game_lis[j][i]:
game_lis[j][i] *= 2 game_lis[j][i] *= 2
score+=game_lis[j][i]
game_lis[k][i] = 0 game_lis[k][i] = 0
break break
@ -173,6 +176,7 @@ def _DOWN():
game_lis[k][i] = 0 game_lis[k][i] = 0
elif game_lis[j][i] == game_lis[k][i]: elif game_lis[j][i] == game_lis[k][i]:
game_lis[j][i] *= 2 game_lis[j][i] *= 2
score+=game_lis[j][i]
game_lis[k][i] = 0 game_lis[k][i] = 0
break break

Loading…
Cancel
Save