(gridSize: Point, ineligibleGridPoints: Point[])
| 86 | } |
| 87 | |
| 88 | function newApple(gridSize: Point, ineligibleGridPoints: Point[]) { |
| 89 | let newApple = randomGridPoint(gridSize); |
| 90 | while (find(ineligibleGridPoints, newApple)) { |
| 91 | newApple = randomGridPoint(gridSize); |
| 92 | } |
| 93 | return newApple; |
| 94 | } |
| 95 | |
| 96 | function growSnake(snake: Snake): Snake { |
| 97 | return [...snake, snake[snake.length - 1]]; |
no test coverage detected
searching dependent graphs…