finished console version of snake.js