SCANNER TECHSJASSI SINGH
← Blog

Can You Win Snake? I Let a Perfect Player Try

Can you win Snake? Yes: fill every square on the board with the snake, so there is nowhere left for an apple. There is even a strategy that can’t lose, which is to follow one loop through every square and never leave it. It is so slow that in my own snake game a perfect player took about two hours to win the easier mode, and a bot that chases the apple carefully never filled more than a fifth of the board.

I make Snake Bite, a snake game for the browser and Android, and it has a real win condition. Its rules run on their own in Node, without a screen, so I could put players through it and time them instead of guessing, as I did for Minesweeper and luck.

What winning Snake means

The snake grows by one square for every apple. Winning means it has grown to cover the whole board. Run into a wall or your own tail before that, and you lose.

What happens when you get there depends on the game. Snake on the Nokia 105 has no ending programmed at all. A clip that went round in 2023 shows the snake filling the screen, the score stopping because no more food can appear, and the snake carrying on as if nothing happened. In 2013, a recording of a classic arcade-style Snake being won did the rounds. I Programmer’s write-up says it took 100 pellets, the snake grew to 801 blocks, and the run lasted 13 minutes 17 seconds.

Snake Bite’s board is 30 squares by 30, so 900 in all. When the snake covers all of them, the game stops and says “You win! You filled the whole board.”

The strategy that can’t lose

Draw one closed path that passes through every square exactly once and ends where it began. Mathematicians call it a Hamiltonian cycle. Now steer the snake along that path forever and never step off it.

The snake can’t hit itself, because its body always lies along a stretch of the path behind the head, and the square ahead is free until the board is full. Every apple appears somewhere on the path, so the snake eats every one of them eventually. A 2025 paper by Graafsma, Manthey and Skopalik proves the general version: on any board that has such a loop, the snake can always win.

On a grid, the easy loop is a comb. Run along the top row, zigzag back and forth down the rest of the board, leaving out the first column, and use that column to climb back to the start. That needs an even number of rows to close. A board with an odd number of squares, like 15 × 15, has no loop at all: colour it like a chessboard, and every step changes colour, so a closed loop needs exactly as many squares of one colour as the other, and an odd number of squares can’t split evenly.

Snake Bite’s own test suite uses exactly this comb. A test plays a full game with it and checks that the snake fills all 900 squares and the game says it won.

How long a perfect game takes

I ran three kinds of player through Snake Bite’s real rules in both of its modes. In Classic the apple sits still. In Hunted it runs away from the snake’s head.

  • Perfect loop: follows the comb, with any bomb sitting in the next few squares of its path removed. This is how the game’s test reaches the win screen.
  • Loop with bombs: the same player, playing the real game, bombs and all.
  • Careful chaser: heads straight for the apple, but when it has a choice, refuses any move that would leave it less room than its own length.
Player Mode Runs Won Typical result
Perfect loop Classic 12 12 won in about 186,000 moves, 2 h 11 min
Perfect loop Hunted 12 12 won in about 829,000 moves, 7 h 13 min
Loop with bombs Classic 40 0 reached 11 squares (best 35)
Loop with bombs Hunted 40 0 reached 4 squares (best 8)
Careful chaser Classic 300 0 reached 62 squares (best 162)
Careful chaser Hunted 300 0 reached 30 squares (best 90)

“Typical” is the median, and “reached” is the longest the snake got before the game ended. Times are game time at the speed the snake was moving, from 10 moves a second at the start up to the mode’s top speed.

Two things stand out. The first is how long a win takes. With the apple still, the snake walks on average half of the free part of the loop to reach each one, and that adds up to about 200,000 moves on a 900-square board. Classic’s top speed is 25 moves a second, so a perfect win took between 1 h 57 min and 2 h 44 min across the 12 runs. In Hunted the apple keeps running away from the head, often further along the route it is about to sweep, and the same player needed between 5 h 57 min and 10 h 42 min.

The second is how far short a sensible-looking player falls. The careful chaser plays the way most of us do: go for the apple, try not to box yourself in. Its median game in Classic ended with the snake 62 squares long, under 7% of the board, and its best in 300 games covered 18%. It always died the same way, trapped by its own body. Chasing the apple is how you get a decent score. It is not how you fill a board.

Why bombs break the perfect strategy

Snake Bite drops bombs on the board, and the loop player can’t dodge. Leaving the loop is the one thing it isn’t allowed to do, so a bomb anywhere ahead on its route is a death waiting to happen. In the real game it never got past 35 squares in Classic, and in Hunted, where bombs come faster as you score, never past 8.

The game does try to be fair about bombs. A new one never lands straight ahead of the head within a set warning time: 0.6 seconds of travel in Classic and 0.28 seconds in Hunted, so the gap widens as the snake speeds up. Each bomb disappears after 250 moves. And once the snake fills 70% of the board, 630 squares, no new bombs appear at all. A comment in the game’s code gives the reason: past that point there’s no free space to dodge into, so a bomb would be a coin flip rather than a challenge.

So a win in Snake Bite needs both halves: a loop-like route that keeps the body tidy, and a human willing to step off it around a bomb and get back on without trapping the tail. The perfect player shows the board can be filled. I haven’t seen anyone do it in a real game yet.

How to get further in Snake

You don’t need a perfect loop to beat your best score. What the numbers above point to:

  • Keep the body in tidy rows. The snake runs out of room because its body leaves pockets it can’t get back into. Long straight runs side by side waste the least space, which is why the comb works.
  • Don’t take the shortest way to every apple. The chaser’s short paths are exactly what trapped it. Pick the route that leaves a way out, even if it’s longer.
  • Follow your tail when in doubt. Unless you’ve just eaten, the square your tail is on will be free on the next move, so heading toward it is the safest way to go.
  • In Hunted, pin the apple against a wall. It runs away from your head, so come at it from the open side and let the wall stop it. One of Hunted’s eggs freezes the apple for 4 seconds.
  • Use the eggs. In Snake Bite an egg can trim your tail, clear every bomb, let you pass through walls for 5 seconds, slow you down, or in Classic give a life back. One can also speed you up, so it is a gamble.
  • Hold on until 70%. Past 630 squares, no new bombs appear, so what’s left is you against your own tail.

Play Snake Bite

Snake Bite is free in the browser on a phone or a computer, with no download. It has the two modes from this post. Classic gives you 3 lives and bombs at a steady pace. Hunted gives you 2 lives, an apple that runs from your head on 85% of its moves and gets faster as you grow, and bombs that come quicker the more you score. The snake speeds up every 12 points, up to a top speed. Eggs hold a random power-up, and the board can be won. Steer with the arrow keys or W, A, S and D, or swipe or use the pad on a phone. It’s also on Google Play and plays the same way.

The honest limits, as of November 2026:

  • Your best score for each mode is kept on your device only. There’s no account and no online leaderboard.
  • There’s no mode without bombs, so the loop strategy on its own won’t win it.
  • A full game takes hours. You can pause, but a run isn’t saved if you close the tab.

Questions people ask

What happens when you win Snake?

It depends on the version. Winning means the snake fills every square, so there is nowhere left for an apple. Some versions show a win screen. Others, like Snake on the Nokia 105, have no ending at all, and the snake just keeps moving with nothing left to eat. Snake Bite shows "You win! You filled the whole board."

Has anyone ever beaten Snake?

Yes, on some versions. A widely shared 2013 recording shows a classic arcade-style Snake won in 13 minutes 17 seconds, on a board that took 100 pellets to fill. On big boards it is far rarer, because a full game takes hours and one mistake ends it.

What is the highest possible score in Snake?

On a board with a win condition, it is roughly the number of squares. Snake Bite's board is 30 by 30, 900 squares, and the snake starts one square long, so a win scores at least 899. Bonus eggs can push it a few points higher.

Is there a strategy that always wins Snake?

On an empty board with an even number of squares, yes. Follow one fixed loop that passes through every square and never leave it. The snake can never run into itself, and every apple is on the loop, so it eats them all eventually. It is very slow, and it stops working once there are obstacles on the board.

The game

Snake BiteBrowserSteer to the apple, dodge the bombs, and in Hunted mode the apple runs away.