How to play Snake
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
- You steer the head; the body follows the exact path the head took.
- Each apple adds one segment and one point. A new apple appears at once, somewhere free.
- In Classic mode, hitting a wall or any part of your body ends the game.
- In Wrap mode there are no walls — you re-enter from the opposite edge — so only your body can end the game.
- The board is 20×20. A perfect game fills all 400 cells.
Controls
| Action | Keyboard | Touch |
|---|---|---|
| Turn | Arrow keys or W A S D | Swipe the board, or tap the on-screen arrows |
| Start / pause | Space or the Play button | Tap the board or Play |
| New game | R | New 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
| Setting | Feel | Good for |
|---|---|---|
| Chill | Roughly six cells a second | Learning the late game without pressure |
| Normal | Roughly nine cells a second | The classic pace |
| Fast | Roughly thirteen cells a second | Reflex 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
- 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.
- 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.
- 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.
- 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.
- 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.