🚀 improve algorithm for enclaved cell

This commit is contained in:
platane
2020-10-23 21:42:35 +02:00
parent 87766811ad
commit 1d24bc8a0f
5 changed files with 103 additions and 45 deletions

View File

@@ -36,7 +36,7 @@ export const getAvailableRoutes = (
const ny = cy + dy;
if (
isInsideLarge(grid, 1, nx, ny) &&
isInsideLarge(grid, 2, nx, ny) &&
!snakeWillSelfCollide(snake, dx, dy)
) {
const nsnake = nextSnake(snake, dx, dy);