Snake — Play Free Online
More Retro Arcade games
A bare-bones Snake
This Snake is about as plain as the idea gets. The page shows the words "Snake Game", a square board with a thick black frame, a score line underneath and one line of instructions. There are no menus, levels, power-ups or colours: the board is white, and both the snake and its food are drawn as small black squares.
The game was written in PureScript, a language that compiles to JavaScript, and the whole thing ships as one script file of about 70 KB. It is a small hobby-sized build, and the page itself names no author.
Controls
The line under the board says "Press Space to start and use Arrow keys to turn." In the code, the snake waits for the first key press and then begins to move, so any key wakes it up; Space is simply the suggested one. After that the four arrow keys steer.
- Up, Down, Left and Right turn the head in that direction.
- A key pointing straight back the way you came is ignored; the game will not let the head reverse into the neck.
- There is no pause key and no touch control. It needs a physical keyboard.
The rules in this version
The playing field measures 20 cells across and 20 down. You start with three segments a little left of centre, heading up, with the first piece of food already waiting near the top left corner. The snake advances one cell every 150 milliseconds, and that pace never changes, no matter how long you survive.
Each time the head lands on the food, the snake grows by one cell and the score goes up by 10. A new piece of food then appears on a random cell. The food square gently pulses in size, which makes it easy to tell apart from your own body.
The run ends when the head leaves the board or runs into the snake's own body. There is no wrap-around at the edges. When that happens the snake simply freezes in place and the score stays on screen; nothing pops up to announce it and no button offers a new game. Refresh the browser tab for another try.
Score display
The counter reads "Score : 000" at the start and always shows three digits. Since every meal is worth 10, the display climbs 010, 020, 030 and so on. It is not saved anywhere, so a high score only lasts until the page is reloaded.
Tips for a longer run
- Because the speed is fixed, the only thing that gets harder is space. Plan turns early once the body is long.
- Write your score down before reloading if you want to beat it later; the page keeps no record.
- Food can appear in any cell of the board, including the edges and corners, so leave yourself a way out before you go in after it.
- The game reads your keys once per step. If you press two arrows inside the same 150 millisecond step, only the last one counts, so a quick double turn around a corner may not happen the way you meant.
Questions about Snake
How do you start this Snake game?
Press Space, as the line under the board suggests. The snake actually starts on the first key press of any kind, then you steer it with the arrow keys.
Does the snake speed up as it grows?
No. It moves one cell every 150 milliseconds for the whole run, so the challenge comes from the growing body, not from speed.
What ends a game?
Leaving the board or hitting your own body. There is no wrap-around, and after a crash the snake freezes; reload the page to start over.
How many points is each piece of food worth?
Each one adds 10 points, and the score counter always shows three digits.