Snake Game
Last updated: 27 June 2026
Reviewed by Gavin Meiring, Lead research and primary author ยท Doctoral Candidate (Corporate Governance) ยท Research and drafting assisted by AI
- The snake slithers back to 1976, when the arcade game 'Blockade' by Gremlin Industries let two players grow walls of pixels โ the direct ancestor of every snake game since.
- Snake became a global phenomenon in 1997, when Nokia engineer Taneli Armanto wrote it for the Nokia 6110 โ the first phone to ship with the game, making Snake the most-played mobile game of its era.
- Armanto's snake sped up as it grew, and the game was so popular that Nokia kept bundling versions for over a decade โ cementing Snake as a rite of passage for every phone owner.
Snake
Snake is one of the most enduring video games ever made. Your snake grows longer with every piece of food it eats, and the challenge becomes keeping the ever-growing tail from running into itself or the walls. Simple to learn, deeply satisfying to master, and just one more game away from a new high score.
How to Use the Snake Game
- Click the game area or press any arrow key to start.
- Use the arrow keys (or WASD) to steer the snake: Up, Down, Left, Right.
- Guide the snake to eat the food items that appear on the board.
- Each piece of food increases the snake's length by one segment and adds to your score.
- The game ends when the snake hits a wall or its own body. Try to beat your high score.
How the Game Works
Snake is played on a grid. The snake occupies one or more cells of the grid and moves one cell per game tick in the current direction. The player can change direction by pressing an arrow key; the new direction takes effect on the next game tick. The snake cannot reverse direction (you cannot go directly from moving right to moving left).
When the head of the snake moves into a cell occupied by food, the score increases and the snake grows by one segment. The food item is removed and a new one appears at a random empty cell on the grid. When the head of the snake moves into a cell occupied by the snake's own body or outside the grid boundaries, the game ends. The game speed increases slightly as the score grows, making longer snakes progressively more challenging to control.
Tips for Winning
- Plan ahead rather than reacting. At higher speeds, reacting to wall collisions leaves no time. Develop a sense of where the snake's tail will be in 3 to 5 moves and avoid trapping yourself.
- Use the walls strategically. Moving along the edges of the board gives you the most open space and the greatest number of turning options, rather than cutting through the middle.
- Avoid making tight spirals. Coiling the snake in a spiral pattern is tempting but often traps the head. Loose, wide turns preserve more open space and allow for easier navigation.
- Do not chase food at the cost of blocking yourself. Sometimes it is worth taking a longer path to food if the direct route leaves the snake in a poor position for the next move.
The History of Snake
Snake traces its roots to the 1976 arcade game Blockade by Gremlin Industries. The concept was adapted into dozens of versions over the following decades. The most famous popularisation came with Nokia mobile phones in 1997, where Snake was pre-installed on the Nokia 6110 and introduced the game to hundreds of millions of people worldwide. Modern versions use the same core mechanics but add features such as obstacles, multiple food types, speed modes, and online leaderboards. The game's enduring appeal lies in its perfect difficulty curve: the rules are trivially simple, but mastery requires genuine concentration and spatial planning.
Frequently Asked Questions
Does the snake wrap around the edges or does it die at the walls? This implementation ends the game when the snake hits a wall. Some versions allow the snake to wrap from one side to the opposite side (toroidal mode); this significantly changes the strategy and makes the game easier at lower scores but introduces new risks when the snake is very long.
Why does the game feel faster as I score higher? The game increases the tick speed as the score grows. Early in the game, each tick (movement step) takes a comfortable amount of time. As your score increases, ticks happen more frequently, giving you less time to change direction. This is the core difficulty scaling mechanism and is what makes reaching very high scores genuinely difficult.
Is there a maximum possible score? Theoretically, the maximum score is reached when the snake fills the entire grid. At that point there are no empty cells for food to spawn. Reaching this requires the snake to trace a perfect path through every cell without collision, which is a well-studied problem in combinatorics and is extremely difficult to achieve manually at high speeds.
Can I play with a controller or on a touchscreen? On touchscreen devices, swipe gestures (up, down, left, right) are mapped to snake direction. On most game controllers connected to a desktop browser, the D-pad or analogue stick should work, though support varies. Keyboard arrow keys and WASD are the most reliable control methods across all platforms.
What the grid size does to the maximum score
The board holds a fixed number of cells. On a square board with N rows and N columns the total is N squared. A 20 by 20 board has 400 cells. The snake starts at three segments and each food item adds one, so the largest score the board can support is 400 minus 3, which is 397. The last food item is the awkward one. When the snake covers 399 cells there is a single empty cell left, and the food must spawn there before the snake can reach it.
| Board | Cells | Maximum score from a three-segment start |
|---|---|---|
| 10 by 10 | 100 | 97 |
| 15 by 15 | 225 | 222 |
| 20 by 20 | 400 | 397 |
| 25 by 25 | 625 | 622 |
| 30 by 30 | 900 | 897 |
That ceiling also explains why a fill-the-board run takes so long. Covering every cell of a 20 by 20 board takes 400 ticks, because each tick moves the head one cell.
How tick timing converts into speed
One tick is one movement step. If a tick takes T milliseconds, the snake covers 1000 divided by T cells each second. The time to cross a 20-cell board is 20T milliseconds, and the time to sweep all 400 cells is 400T milliseconds.
| Tick interval | Cells per second | Seconds to cross 20 cells | Seconds to sweep 400 cells |
|---|---|---|---|
| 150 ms | 6.67 | 3.00 | 60.0 |
| 125 ms | 8.00 | 2.50 | 50.0 |
| 120 ms | 8.33 | 2.40 | 48.0 |
| 100 ms | 10.00 | 2.00 | 40.0 |
| 80 ms | 12.50 | 1.60 | 32.0 |
| 60 ms | 16.67 | 1.20 | 24.0 |
Those figures are arithmetic and hold for any build. The curve that maps score to tick interval varies between implementations, so the table does not tell you the interval at a given score. It tells you what a given interval feels like. At 150 ms the snake crosses the whole board in three seconds, which is slow enough to correct a mistake. At 60 ms the crossing takes 1.2 seconds, which is not. For a build whose interval starts at 150 ms and falls by 2 ms for every item eaten, the interval passes 120 ms after 15 items, 100 ms after 25 items, and 80 ms after 35 items. That shape is an example, not a claim about this one.
The collision test and why the data structure matters
Every tick, the game asks whether the cell the head is about to enter is already occupied. The answer decides whether the run continues. The cost of that question depends on how the occupied cells are stored.
A list of segments costs one comparison per segment in the worst case. A hash set of occupied cells costs one lookup. The difference is invisible on a short snake and real on a long one.
| Snake length | Comparisons per tick with a list | Comparisons per second at 20 ticks per second |
|---|---|---|
| 20 | 20 | 400 |
| 50 | 50 | 1,000 |
| 100 | 100 | 2,000 |
| 200 | 200 | 4,000 |
There is one subtlety that catches most first attempts. The tail cell empties on the same tick that the head arrives in the cell next to it, so a snake can legally move into the square its tail is leaving. A collision test that compares against the full body rejects that move and ends the run early. The test has to compare against the body minus the tail, or the tail has to be removed from the occupied set before the head is checked.
A serpentine route covers every cell
The route that fills a board without revisiting a cell is a boustrophedon, or ox-turn, path. Sweep left to right along the top row, drop one row, sweep right to left, drop one row, and continue. On a board with an even number of columns the path ends in the column where it started, one row below the start.
That matters at the end of a long run. When the board is crowded and the food is somewhere inconvenient, following the serpentine keeps an exit open. Weaving a long thin snake through the middle of the board does not. The practical version of the advice is to keep the snake compact and to treat the serpentine as the fallback route once more than half the board is occupied.
A perfect serpentine cannot be followed while chasing food, because the food spawns at random. The route is a plan for the endgame, not a plan for the whole run.
Also try these free tools: