Implemented rand() and automove for snake.