Make absolutely certain we sent a direction turn command

This commit is contained in:
sigonasr2 2022-08-17 13:08:08 -05:00
parent 4e03338291
commit c34811fdf4
2 changed files with 8 additions and 6 deletions

6
data
View File

@ -1,7 +1,7 @@
Hit other Hit other
923 923
500 504
62775 63224
954 954
Bot 5653 Bot 5653

View File

@ -166,10 +166,12 @@ snake.onTick = function(obj) { // When the game updates
} }
function setDirection(dir) { function setDirection(dir) {
if (myDir!==dir) {
for (var i=0;i<10;i++) {
snake.setDirection(dir) snake.setDirection(dir)
myDir=dir
} }
myDir=dir
} }
function spotIsFree(dir, x, y) { function spotIsFree(dir, x, y) {