Play Snake on a 20 x 20 grid with keyboard, swipe or on-screen buttons. Pick a speed and choose between deadly walls or wrap-around edges.
Score 0
Best -
Length 3
Arrow keys or WASD steer, Space or P pauses. On a touch screen swipe on the board or use the buttons. The game waits until your first move. Changing speed or walls starts a new game.
Each step the head moves one cell. Eating food adds one segment and one point, and new food appears on a uniformly random empty cell. Running into yourself ends the game. The tail moves out of the way on the same step, so following right behind your own tail is safe. With walls on, the edge ends the game; with wrap on, you come out on the opposite side. Fill all 400 cells and you win.
As-is, no warranty. These apps are free under their listed license and run entirely in your browser. Use at your own risk — don't blame me if your PC catches fire, your dog runs away, or the math turns out wrong. Verify anything that actually matters. None of this is professional financial, medical, legal, or engineering advice.
Steer the snake to the food. Each piece you eat adds one segment and one point. Do not run into your own body, and do not run into the edge if walls are on.
The game pauses itself when you switch to another tab and waits for you to resume.
The snake is smooth and rounded, and its colour runs from a sky-blue head through violet to a rose tail, so a long snake shows which end is which. The food is a glowing amber berry. The board is a soft checker of two tints. Two eyes on the head show which way the snake faces. The only decoration that moves is the frame around the board, which changes colour when a game starts or ends; if your device asks for reduced motion, that is switched off too. The snake itself always steps one cell at a time.
Two settings change the game, and changing either starts a new game:
| Setting | Options |
|---|---|
| Speed | Slow 6, Normal 9, Fast 13 steps per second |
| Walls | Walls end the game, or Wrap around |
With wrap-around on, the board has no edge: leave the right side and you come in on the left. The board border turns dashed to show it. Your best score is stored separately for each of the six combinations, so a fast wrap-around score never replaces a slow walled one.
A result only counts as a best if it is a whole number of food eaten, at least one, and no more than the largest score the board allows (397, since the snake starts with three of the 400 cells). Filling every cell is a win.
The engine is a pure function with no page attached: step(state, direction, rng) returns the next state and never changes the old one. That makes the rules easy to pin down with tests, and a game replays exactly when given the same random numbers.
The tests run a few hundred random and food-seeking games on several board sizes, with and without wrap-around, and check after every single step that no two segments overlap, every segment is on the board and next to the previous one, the length equals the starting length plus the food eaten, and the food is never on the snake. A scripted path that visits every cell wins on 4 x 4, 6 x 6 and 8 x 8 boards.
Nothing is uploaded and there is no account. Your best scores are saved in your browser’s local storage under one key, as small numbers inside a small JSON object, one per speed and wall combination. The page address holds your speed and wall setting so you can share it. Clearing site data removes the scores.
Everything runs locally in your browser.
For informational purposes only. Not financial, medical, or legal advice. You are solely responsible for how you use these tools.