Snake is the arcade classic almost everyone has played at least once: a line that crawls around a square board, grows a segment every time it eats, and dies the moment it runs into itself. It first reached a mass audience in the arcade game Blockade in 1976 and then on Nokia phones in the late nineties, and the rules have not needed changing since.
The tension comes from your own success. A short snake can turn anywhere it likes; a long one is a maze of its own making, and every piece of food you take makes the next one harder to reach. Good players do not chase the food - they plan a route that keeps a clear path back to open space.
This version runs at a smooth frame rate with interpolated movement, ramps the speed up as you grow and lets you choose between solid walls and wrap-around edges. Your best score is kept locally on your device.
How to play Snake
Press an arrow key, swipe the board or tap Start game to set the snake moving. It never stops, so your only job is choosing where to turn.
- Steer with the arrow keys or W A S D on a keyboard, or swipe on a touch screen. On phones, an arrow pad also appears below the board.
- Each piece of food adds one segment to your tail, scores 10 points and makes the snake slightly faster.
- Running into your own tail always ends the run.
- Running into a wall ends the run when walls are solid. Switch them to open and the snake passes through the edge instead, reappearing on the other side.
- Space pauses and resumes. On touch, tap the board.
The snake cannot reverse directly into itself, so a quick down-then-up input is ignored rather than fatal.
Tips and strategy
Hug the edges early
While the snake is short, run laps around the outside of the board and only cut inward to collect food. Food that spawns in the middle is easy to reach from a lap; food that spawns on the edge is awkward to reach from the middle.
Never cut off your own escape
Before taking a piece of food, check that you can still get out of the space you are entering. The classic losing move is diving into a pocket surrounded by your own tail, eating, and finding the only exit now blocked by the segment you just grew.
Think in rows, not in dots
Strong players follow a repeating pattern - up one column, down the next - that sweeps the whole board. It looks slow, but the snake never traps itself, and food always ends up on the path eventually.
Leave a gap along one wall
Keep one column or row permanently clear as a return corridor. When the board gets crowded, that corridor is the difference between a reachable piece of food and a dead end.
Slow your inputs as the snake speeds up
At high speed the common mistake is double-tapping a direction and overshooting a turn by one cell. Queue a single turn and let it land before pressing anything else - the game buffers up to three turns, but anything more is you fighting yourself.
About Snake
Snake has a longer history than most people expect. The two-player arcade game Blockade, released by Gremlin in 1976, had the core idea: a trail that grows behind you and kills you on contact. Home computer versions followed through the eighties under names like Worm and Nibbler, and in 1997 Nokia put a one-player version on the 6110, which put the game in the pocket of hundreds of millions of people.
Its survival has a lot to do with how little it needs. There are no levels, no upgrades and no story - just a grid, a growing line and a single rule about collisions. The difficulty curve is generated by the player's own play rather than by any design, which is unusually elegant.
This implementation was written from scratch in plain JavaScript and HTML5 Canvas. Movement is interpolated between grid steps so the snake glides rather than jumping cell to cell, and the game pauses itself when you switch tabs.
Snake FAQ
How do you play Snake?
Steer the snake around the board with the arrow keys or by swiping. Every piece of food you eat adds a segment to your tail and speeds the game up slightly. You lose if the head hits your own body, or a wall when solid walls are switched on.
What do solid and open walls mean?
With solid walls, touching the edge of the board ends the run - that is the original arcade rule. With open walls, the snake wraps around and reappears on the opposite side, which makes long games far more forgiving. Use the Walls button above the board to switch between them at any time.
Does the snake get faster?
Yes. Each piece of food shaves a few milliseconds off the step time, from 150 ms at the start down to a floor of 68 ms. By the time your tail is thirty segments long you are moving roughly twice as fast as you started.
Can I play Snake on my phone?
Yes. Swipe anywhere on the board to turn, or use the on-screen arrow pad that appears below the board on touch devices. Tap the board to pause and resume.
Is my high score saved?
Your best score is stored in your browser's local storage, so it survives closing the tab. It stays on your device and is never uploaded anywhere.
What is a good Snake score?
Each piece of food is worth 10 points. Breaking 200 means you are steering well; above 500 you are managing a tail long enough that every turn has to be planned several steps ahead. Filling the entire 21x21 board would be 4,400 points and is effectively a perfect game.