Snake against the computer

Play snake online against a computer snake on the same board: race for the apples, cut it off, don't crash. First to three rounds wins. Free, no sign-up.

What this game is

Snake is one of the best-known computer games there is: a head leads a body around the field, every apple makes the tail longer, and you must not run into anything.

Usually there is one snake, and its opponent is its own tail. Here there are two on one field: your red one and the computer's blue one. The apples are shared, room is short, and each snake is a wall for the other. You can beat the other to an apple, or cut off its way and wait for it to run into a dead end.

A match is played to three rounds. A round goes to the snake that first grows to length 15 — or to the one still alive.

Rules

How to play better

A bit of history

Snake grew out of Blockade, an arcade game released by Gremlin in 1976: two players steered growing lines around the screen and tried not to crash. It is a close relative of Tron on this site — two opponents leaving a wall behind them.

The single snake that grows as it eats then lived on home computers, and became world-famous in 1997, when it was built into Nokia mobile phones: hundreds of millions of people who never owned a games console played it.

For a programmer, snake is a neat problem in pathfinding and judging space: it is not enough to find a way to the apple, you must not trap yourself where there is no way out. The same ideas — breadth-first search, flood fill, counting territory — run the bot tournaments where snakes play each other.

About the levels

Normal heads for the nearest apple in a straight line, seeing no obstacle beyond the next square, and makes one move in five at random. It is easy to trap.

Hard finds the real shortest path to an apple around both bodies, and never crawls into a pocket smaller than its own length.

Expert moves faster, keeps clear of your head while it is not the longer snake, goes for the apples it can reach before you, and when nothing else decides, picks the move that leaves it more of the field than you.

Where to go from here