- Snake moves up, down, left, right.
- You can not move snake to opposite direction immediately (if snake goes up
down
is not valid command, so it will be skipped, technically snake will continue moving up). @
= food,o
= snake head,x
= snake body- Game over when snake collides with itself.
- Snake grows when it "eats" food pellet.
- Better test coverage
- Pick randomly init food pellet
sbt "runMain io.mikla.snake.Simulate"
sbt "runMain io.mikla.snake.Play"
Use U
, D
, L
, R
(also its lowercase variants) to control snake, or just any other input to continue snake moving
forward