How to play Snake

Updated September 18, 2026 · The AI Snake guide

Snake has one rule you learn in five seconds and one skill that takes a while: the rule is "don't hit anything", the skill is planning for a body that is much longer than the gap you are aiming at. This guide covers the rules and controls of AI Snake, then the handful of habits that separate a score of 30 from a score of 200.

The rules

Controls

ActionKeyboardTouch
TurnArrow keys or W A S DSwipe the board, or tap the on-screen arrows
Start / pauseSpace or the Play buttonTap the board or Play
New gameRNew game button

Turns are buffered two deep, so a fast up, left makes a tidy one-cell hook. Pressing the opposite of your current direction is ignored — you cannot reverse into your own neck.

Speeds

SettingFeelGood for
ChillRoughly six cells a secondLearning the late game without pressure
NormalRoughly nine cells a secondThe classic pace
FastRoughly thirteen cells a secondReflex practice, and watching the AI finish a board

Early game: don't sprint

While you are short, any route works and the apple is never far. The mistake is to build habits that only work when you are short — diagonal-ish zigzags across the open middle, sharp reversals, cutting corners. Those are exactly the moves that trap a long snake. Practise the late-game habits below from the start, even though you do not need them yet.

Late game: the habits that matter

  1. Hug the edge. A snake running along the wall keeps the whole interior open. A snake wandering through the middle slices the board into pockets, and sooner or later you enter a pocket that is smaller than you are.
  2. Keep a loop. Think of your body as a wall you are building. Always leave a corridor that leads back to your tail, and do not seal it just to grab an apple.
  3. Follow your tail. When there is no safe route to the apple, head toward your own tail. It is the one thing on the board that is guaranteed to be moving out of your way, so there is always room where it has just been. This is also exactly what the game's Safe search AI does when it gets stuck.
  4. Sweep in lanes. The tidiest long-snake pattern is to sweep the board in parallel lanes — down one column, up the next — like mowing a lawn. It is slow, but it never traps you, and it is the human version of the Hamiltonian cycle the AI uses to fill every cell.
  5. Turn before you must. Decide the exit before you enter. If you cannot picture the way out after eating, the apple can wait.

Watch it done. Press Auto on the game and pick Hamiltonian cycle: that is the lane-sweeping pattern, executed perfectly, all the way to 400.

Wrap mode tactics

Wrap removes the walls, which removes your safest lane. In return, the edges become shortcuts — the nearest apple is often through the border. Two adjustments: keep your loop in the interior instead of along the edge, and remember that exiting one side puts your head next to whatever is on the other side, including your own tail.

Scoring

Score equals apples eaten, which equals your length minus the three segments you start with. Your best score is kept separately for Classic and Wrap, in your own browser — nothing is sent anywhere.

Play AI Snake