How to Play Snake

Steer a line of cells around a grid. It moves one cell every tick on its own; the arrow keys, WASD, the on-screen pad and a swipe all turn it. Eat the apple to grow by one cell and score the snake's new length. Hitting a wall or your own body ends the run. Fill every cell on the board and you have won outright.

The rules, step by step

  1. 1The snake moves on its ownOne cell forward every tick, in whichever direction it is heading. You never make it move; you only decide where it turns, and doing nothing is a decision too.
  2. 2Turn with the arrows, WASD, the pad or a swipeTurns are queued up to two deep, so pressing up and then left inside a single tick takes both corners in that order rather than throwing the first one away.
  3. 3You cannot turn back on yourselfThe direction opposite your heading is refused. It is the one key that would put the head on its own neck, and a game that obeyed it would be killing you for a mistyped finger.
  4. 4Eat the apple to growThe head moves onto the apple, the tail stays where it is, and the snake is one cell longer. A new apple appears on a cell the snake is not occupying.
  5. 5The walls are solidStepping off any of the four edges ends the run. There is no wrap-around, so the corners are the most dangerous cells on the board and the edges are only safe in one direction.
  6. 6Your body is solid, except the tail you are leavingTouching any cell of the snake ends the run — but the cell the tail vacates this tick is already empty by the time the head arrives, so chasing your own tail round a tight loop is legal and always has been.
  7. 7Fill the board to winWhen the snake occupies every cell there is nowhere to put an apple, and that is the win. It needs 141 apples on the small board, 253 on the medium and 397 on the large.

Try it — the rules above, running

Score0Best0Length3Free253Applerow 12, column 12Game#1

New game deals a fresh board at the size and speed you last chose, and the play button beside it is Start, Pause and Resume in turn — Space does the same thing. Turns are queued up to 2 deep, so pressing up and then left inside one tick takes both corners rather than only the second, and the key opposite your heading is ignored instead of feeding you your own neck. The three-dot menu holds today’s shared game, the three boards and the four speeds. Pausing saves the board; nothing else does, because a run changes six to seventeen times a second.

Your statistics · 16 × 16

Played
0
Won
0
Win rate
0%
Streak
0
Best streak
0
Best time
—
Best score
—

A run is recorded when it ends. It counts as a win if the snake reached par for this board — 40 cells, which is 814 points — because filling all 256 is worth 32,890 and almost nobody will ever see it. The best score is kept whether you cleared par or not, and the speed you play at never changes it.

This board

256 cells, the standard board. Thirty apples leave the snake 33 long, 13% of the board, so a run has a genuinely open first half and a crowded second. All 253 apples scores 32,890.

Steady: About 8.3 cells a second. The default here, and the middle of the four. The tick never speeds up as the snake grows. Game #1 fixes every apple draw in advance, so the same moves bring out the same apples on any device — you start 3 long and the first apple is worth 4.

Keyboard

Arrows
Turn — queued, so two turns can be pressed inside one tick
W A S D
The same four turns
Space or P
Start, pause, resume
N
New game
F
Full screen

How do you start a snake game?

  1. 1Pick a board and a speedThe three-dot menu holds 12 × 12, 16 × 16 and 20 × 20, and four clocks from 170 ms a tick down to 60 ms. Start on 16 × 16 at Steady, which is the default here and the middle of the four clocks.
  2. 2Set offThe clock does not run until you ask it to. Press an arrow, swipe the board, or press the play button — the snake starts three cells long, heading right, a third of the way across.
  3. 3Take the apple, then look upGetting to the apple is rarely the problem. The moment it is eaten, find the next one and decide which side of it you want to arrive from.
  4. 4Pause when you need toSpace stops the clock and saves the board, and switching away from the tab pauses it for you. A background tab throttles timers, so a game left running there creeps instead of stopping.

Which controls turn the snake?

Every route into the game
ControlWhat it does
Arrow keysTurn — queued two deep, so two presses in one tick both count
W A S DThe same four turns, for a hand already on the left of the keyboard
SwipeTurn in the direction of the drag; keep dragging and it keeps turning
Direction padFour real buttons under the board, for a thumb or a switch
Space or PStart, pause and resume
NA new game on the same board and clock
FFull screen

The pad exists because a swipe needs a twenty-pixel drag and not every player can make one. Every action in this game is reachable from the keyboard alone, and the status line under the board announces what changed — the apple, the length, the score and how the run ended — for anyone who is not reading the grid.

How do you avoid trapping yourself?

  • Keep the free space in one piece. A run ends when the apple is somewhere your head can no longer reach, and that happens long before the board is full.
  • Treat corners as one-way. A corner has two exits and your own body usually takes one of them, so entering a corner without knowing which way you are leaving is how short runs end.
  • Count before you commit. If the gap you are about to enter is narrower than your snake is long, you are entering a pocket you cannot turn round in.
  • Remember the tail moves. The cell behind your last segment is free on the very next tick, so a gap that looks one short is often exactly wide enough.

How long does a perfect game of snake take?

Played the safe way — following a closed tour that visits every cell — a perfect game on the 12 × 12 board is under 6,000 ticks, which is around twelve minutes at the Steady clock and six at Blitz. The 16 × 16 board is roughly three times that and the 20 × 20 board roughly eight times. Nobody plays it that way, because the tour crosses the whole board between apples; cutting corners is faster and is also the thing that gets you killed.

A far more useful target is par, which is what the statistics panel counts as a completed game: a snake 30 cells long on the small board, 40 on the medium, 50 on the large. That is 459, 814 and 1,269 points respectively, and it is an afternoon's practice rather than a lifetime's.

How do you win more often?

  • Stay on the outside earlyRunning the perimeter costs a few ticks per apple and keeps the middle of the board empty, which is where you will need room later. A snake that wanders through the centre while it is still short has cut the open space into two pieces for no gain at all.
  • Never cut the board in twoThe fatal mistake is not hitting yourself; it is sealing off a region with the apple on the wrong side of the wall you just built. Before committing to a line across open space, look at what is left on each side of it and ask whether you can still reach both.
  • Follow your own tail when you are stuckThe cell your tail is leaving is empty by the time your head could reach it, so a loop that chases the tail is always survivable and can be held indefinitely. It buys nothing by itself, but it converts a panic into time to see where the next apple actually is.
  • Plan the exit before the entryApproach an apple from the side that leaves you an open direction afterwards. Eating from a dead end works once and then you are one cell longer in a pocket with a single way out, which is the usual way a promising run ends.
  • Bank the corner in one motionBecause turns are queued two deep, up-then-left is a single instruction here rather than a race against the tick. Press both keys as one movement and the snake takes the corner exactly as you drew it, which is much more reliable than waiting for the first turn to land.
  • On a crowded board, take the long wayOnce the snake covers a third of the cells, sweeping the board in rows costs more ticks but leaves the free space in one connected piece. Short cuts are what leave a scatter of one-cell holes that nothing can ever fill again.

Common questions about snake

What is the fastest way to get better at snake?
Slow the clock down. Most early deaths are planning failures rather than reaction failures, and Calm at 5.9 cells a second gives you the time to notice that you were about to seal off a corner. Speed up once you stop trapping yourself.
Is there a way to win snake every time?
There is a way that never loses: follow a closed tour of the board, which exists on every even-sided grid and keeps the snake's body in one unbroken run along it. It is also the slowest possible game, so it is a proof that the win is real rather than a way anyone plays.
Why did the snake not turn when I pressed the key?
One of three things. You pressed the direction opposite your heading, which is deliberately ignored; or you pressed the direction you are already going in, or have already banked, which is not a turn at all; or you already had two turns queued and the third was refused rather than allowed to push one out. The status line says so when it was a reversal. On a board that has not set off yet, all four arrows start it whether or not they steer it.
Does this snake game work offline?
Yes. There is no server, no account and no database behind it — the whole game is a few kilobytes of logic in your browser, so it keeps playing on a plane and in the phone apps, which are the same pages in a native shell.

Ready to stop reading? Play snake on the full board, with controls and statistics tailored to that game.