Added javascript code for snake.