Snakeyard
A tidy snake game for a two-minute break. Pick a board, steer with the arrow keys, W A S D, a swipe, or the buttons, and try not to bite yourself.
Ready. Pick a board, then press New game.
- Score
- 0
- Level
- 1
- Run clock
- 0s
- To beat
- —
Your last finished run, as a line you can copy
Nothing is stored, so a copy is the only way to keep a score past a reload.
How to play, in three lines
- Pick a board above, then press New game (or the Enter key).
- Steer with the arrow keys or W A S D — or swipe on the board, or use the Up / Left / Right / Down buttons. Pause with the space bar, the P key, the Pause button or a tap on the board.
- Eat the food to grow and score. Hitting a wall, a grey block, or your own tail ends the run.
Blocks, walls and pace
These three switches sit here, under the board, so the board itself stays near the top of a phone screen. Any of them can be changed while a run is going. Two of the three take hold on the spot; the third, the grey blocks, is not a plain switch — the blocks already standing stay where they are and the switch decides what a fresh board is built with, and unticking it part-way through a run also stops any further block dropping in for the rest of that run. The bullet on the grey blocks below says what that switch does then.
Keys and controls
- Arrow keys or W A S D — steer the snake, whatever has focus on the page.
- Space bar or the P key — pause and carry on. Enter — start a new game, or pause a run that is under way. The N key is the New game button in key form; the one exception is a run under way with points on the board, where the first press only asks and a second press within five seconds starts the new game.
- The 1, 2, 3 and 4 keys pick Cozy 12×12, Classic 16×16, Tight 20×20 and Huge 24×24 — the same four board buttons, so you need not tab to them. While a run is under way with points on the board the key touches nothing: it only puts a short line under the status line naming the rule the key kept — the board keys change the board only when no run is under way, or on a run that has eaten nothing yet — and adding that the four board buttons above still work, with a change there starting a fresh run. This sentence described that line as saying only that the keys work between runs until version 2.46, which left out the run that has eaten nothing yet; the line itself has named the rule in full since version 2.32. Before a run, after one, or on a run that has eaten nothing yet, the key presses the matching board button.
- The H key works the how-to box itself: pressed while the three-line box is on the page it puts the box away, the same as the box's own button labelled "Got it — hide this", and pressed while the box is hidden it brings the box back, the same as the small button the box leaves behind, labelled "Show the how-to again (or press H)". It steers nothing and pauses nothing, so a run under way is untouched by it; a Ctrl, Cmd or Alt chord is left to the browser, and a held H counts once (since version 2.17). The Escape key works the box too, and in one direction only: pressed while the box is on the page it hides the box, exactly as the Dismiss button does, and pressed while the box is already hidden it does nothing at all, so it can never bring the box back and can never touch a run. The how-to script has hidden the box on Escape for as long as the box has been re-openable, but no line on the page has named the key until now (since version 2.47); the two key lists name it here and under "Keys and focus".
- A new game does not move at once: the snake holds still for 900 ms before its first step, so a hand can get back to the keys, a swipe or the buttons. The status line, the panel over the board and the "Get ready" bar on the board all say so; a pause during that wait keeps the rest of it.
- Once a run has ended, a click on the board (or a tap on a phone) starts a new game, the same as the New game button. While a game is running or paused, a click on the board only hands the keyboard back to the game, and a tap pauses it or carries it on. On a board whose run has not started there is nothing to pause, so a tap answers in words — "Nothing to pause yet. Press New game first.", the same words the space bar and the Pause button write on that screen (since version 2.34) — and a click only hands the keyboard back.
- Starting a game, pressing Pause or steering with a direction button moves the keyboard focus to the board, so the space bar and Enter reach the game. A control you reached with the Tab key keeps those two keys while it holds the focus; a control you clicked or tapped with a pointer lets them go as soon as the click has been acted on (since version 1.77), so the setting still changes and the keys come back. Press Tab, or click the board, to hand them back either way.
- A run pauses by itself if the page stops being what you are looking at — another tab, another window, or a click on the toolbar. Come back and press the space bar, Enter or the Resume button. On a phone the Up, Left, Right and Down buttons steer as well as a swipe.
- Best this visit
- 0
- Best on each board
- —
- Games played
- 0
- Food eaten
- 0
- Step time (ms)
- 135
- Blocks on board
- 0
- Last 3 runs avg
- Recent runs (newest first, last six)
- —
How it works
Built by an AI agent. No ads, no accounts, no tracking — the whole game is one static page, and nothing is stored between visits.
The boards and the pace
- Four boards, slowest first: Cozy 12×12 at 190 ms a step, Classic 16×16 at 135 ms, Tight 20×20 at 95 ms, Huge 24×24 at 80 ms. Unless you switch on speed-up, the pace stays fixed for the whole run.
- Each piece of food is 10 points and one segment longer. Every 5 pieces takes you up a level, and the status line, the pause panel and the ending panel name the level you reached. A new game starts at level 1.
- With speed-up on, each piece of food shaves 6% off the step time, to a floor of about a third of the starting pace.
- Fill the whole board and the game says so: "Board full!" names the board you filled with your score, level and the pace you cleared it at. It is a long shot on anything but Cozy 12×12 with the blocks off.
- Blocks, when switched on, start at the same spots every game, in two mirrored rows that stay clear of the row the snake starts on: 8 on Cozy, 12 on Classic, 16 on Tight, 20 on Huge. Touching one ends the run, like a wall. From level 3 up, one extra block drops in each time you level up, at most six more than the board started with; unticking the blocks switch part-way through a run stops that growth for the rest of that run, as the bullet on the three switches below says. A new block is never put on the food or the snake, beside the head, or in the three squares straight ahead. Food is never put in those three squares either, unless the board is nearly full and a meal still has to be placed.
- The four board buttons sit near the top of the page, straight under the lead paragraph; the how-to box sits further down, under the direction buttons, and the three switches below that — so the board, the New game and Pause buttons and the numbers stay near the top of a phone screen. Two of the three switches take hold the moment you touch them, this run included: ticking Walls off while the snake is in a corner can drive it back out through the edge, and ticking Speed up drops the step time on the spot — every piece of food already eaten this run counts for 6% off the pace, so a run that has eaten eight pieces loses nearly half its step time the moment you tick the box, and a new game starts that count over (the read-out's "Step time (ms)" cell shows the new figure the moment the switch is touched). The grey blocks are the exception: the set of blocks is only built when a fresh board is set up, so ticking or unticking that switch mid-run leaves the blocks already standing exactly where they are and takes effect on the next board (the status line says which). One thing does change at once when the switch is unticked — on a board that was set up with blocks, no further block drops in for the rest of that run, because the growth reads the live switch as well as the board's own set — and the other way round, ticking it on mid-run builds nothing and adds nothing to the board in play. This sentence names both (since version 2.40), and the short note at the head of this panel names the switch the same way (since version 2.42).
Starting, pausing and ending a run
- A new game holds still for 900 ms before its first step, so the snake never moves the instant you press the button. It is the same step clock, started 900 ms in the red, so every later step keeps the board's pace. The board counts that wait down with a small "Get ready" label and a bar; a pause in the middle of the wait keeps the rest of it, and the run clock counts the wait as part of the run.
- Pause with the space bar, the P key, the Pause button or a tap on the board; carry on the same way, or with Enter or the Resume button. A running game also pauses by itself the moment the page stops being what you are looking at — another tab, a phone that has been locked, another program, or a click on the browser's toolbar — and the status line says which of the two happened: "the page went out of sight, so the snake is standing still" when the page itself was hidden, and "the window lost focus, so the snake is standing still" when the window is still on screen but no longer the one you are working in. Both lines carry the visit best, the run clock so far and the way out of the pause. The first of the two was silent until version 2.45: a hidden page stopped the snake but left the status line reading whatever had happened last in the run. A pause reports the time so far.
- A run ends on a wall, on a grey block or on your own tail. When it ends on a block or on the tail, the square that ended it keeps a red cross on the board until the next run starts, and the status line says so; a run that ended on the wall has no square to mark.
- Once a run has ended, a click or a tap on the board starts a new one, the same as the New game button. During a run that is going or paused, a click on the board only hands the keyboard back to the game, and a tap pauses it or carries it on. On a board whose run has not started, a click still only hands the keyboard back, while a tap answers in words: "Nothing to pause yet. Press New game first." — the same words the space bar and the Pause button write on that screen (since version 2.34).
What the read-out shows
- Score, Level, Run clock and To beat sit on their own small line just under the status line, right below the board, so the numbers a player watches while playing stay on screen on a phone. Three of the four are the game's own counters; the fourth, To beat, is a copy of one number from the read-out further down the page — the best standing on the board you have picked — so a player chasing a best can see the target without looking away from the board. It reads the same em dash that cell uses, and it follows the board you have picked: pick another board and the figure becomes that board's best, or the em dash again, and a run on the board you have picked that ends with points on it updates it (since version 2.21). On a phone the four cells lie two by two, and on a screen 28rem wide or more they lie in one row.
- The other eight cells are further down the page, under the direction buttons: Best this visit, Best on each board, Games played, Food eaten, Step time, Blocks on board, the average of your last three finished runs, and your six most recent runs newest first with the board each was played on, followed by a count of the finished runs that are not in that line — "(+12 earlier)", for example. That count and the Games played cell both rise with every run that ends, so the two keep step however long you play: the Games cell has counted a run as it ends, rather than as it starts, since version 2.25, which is how the read-out under a finished run has always been counted. A run you walk away from by picking another board mid-run ends nothing, so it is counted nowhere — not in the Games cell, not in the recent-runs line, and not in its count. The count is left off until there is something earlier to count. The last of the eight carries a short label, "Recent runs (newest first, last six)": how many runs the line holds and which end the newest one is at; that each run names its board and that a count of earlier runs follows is said here, under this bullet.
- The average adds scores up whichever board they came from, so on a visit that has mixed boards it is a rough figure; the board named beside each run in the list, and the per-board bests, are what make two scores comparable. "Best on each board" keeps a separate best for each of the four boards, and only a run that ended on its own with points on the board sets one: a run that ends having eaten nothing leaves that board as it was, so a board you have only died on still reads as having no best at all.
- The idle screen before a run is a card for the board you have picked: it names that board and its pace in the same words the pause and ending panels use ("Classic 16×16 at 135 ms a step"), and once a run on that board has ended with points on it, it adds the score to beat. Each ending names the same board and pace, and how the run stands against the best finished on that same board — level with it, a new best on it, or so many points behind it.
Keys and focus
- Arrows or W A S D steer, wherever the focus is. Space or P pauses and carries on. Enter starts a new game, or pauses a run that is under way. N is the New game button, except during a run with points on the board, where the first press only asks and a second press within five seconds starts the new game. The 1, 2, 3 and 4 keys pick Cozy, Classic, Tight and Huge, but never mid-run with points on the board — a slip must not reset a run that is going well. H works the how-to box instead of the run: it puts the three-line box away, or brings it back, and it steers nothing and pauses nothing. Escape works the box as well, but one way only — it puts the box away when the box is on the page, and while the box is already hidden it does nothing at all, so it can never bring the box back and never touches a run (named here since version 2.47). While there is no run to steer or pause the game leaves the arrow keys and the space bar to the browser, so with the board sitting still they scroll this page as usual (since version 1.99). Ctrl, Cmd or Alt presses are left to the browser, and a held key counts once (H included, since version 2.17).
- An input that cannot act answers in words rather than in silence. Press the space bar or P with no run under way and the status line says there is nothing to pause yet; press N or a board key while a run with points is going and a short line says so; steer — an arrow, W A S D, a swipe or a direction button — while the game is paused and the line reads "Paused: the snake is standing still. Space bar, Enter or Resume to carry on."; steer before a run and it reads "Nothing to steer yet. Press New game to play, or pick another board." (since version 1.93); and a tap on a board whose run has not started answers with the same pause line the space bar writes there (since version 2.34). One input is silent on purpose: a steering key after a run has ended, so the ending line under the board stays readable — Enter, New game or a click on the board all start the next run from there.
- Starting a game, pressing Pause or steering with a direction button moves the keyboard focus to the board, so the space bar and Enter reach the game rather than a button you have finished with. A control you reached with the Tab key keeps those two keys while it holds the focus, which is how a keyboard-only player works the settings with the space bar; a control you clicked or tapped with a pointer lets them go as soon as the click has been acted on (since version 1.77). Press Tab, or click the board, to hand them back — and the arrows and W A S D steer either way, so you are never stuck without a way to turn.
Keeping a score
- After a run ends, a card below the four-cell row — the row of Score, Level, Run clock and To beat, which is the line directly under the status line — writes it out as one plain sentence — "Snakeyard: score 80 at level 3 in 47s on Classic 16×16 at 135 ms a step. Your best on Classic 16×16 is 120, 40 ahead of this run. Best this visit 140 after 4 games (set on Cozy 12×12), 60 more than this run." — with a button that selects it, so Ctrl/Cmd + C takes it away with you. The card sits directly under that four-cell row, and the row is what lies directly under the status line: the four cells have held that spot since version 2.10, so the card is one element lower than this sentence used to say (put right in version 2.43). It is built from the same ending line and the same counters the page already shows, so it cannot disagree with them, and a run that beat your earlier best is marked "new best" at the front. Since version 2.04 it also ends with the run average once a second run has finished ("Last 3 runs average 96.") — the same figure as the "Last 3 runs avg" cell, so a copied score carries how the visit is going, not just one run. The card stays empty until your first finished run, and a game you walk away from by changing the board mid-run is not offered, because it ends without an ending line.
- Nothing is stored: your score, the board bests, the run list, the run average and the counters live only in this page and reset when you reload. The copyable line is the one way to keep a score past a reload.