About Code Snake: A Coding Game Where Your Program Plays Snake
Real programming ideas: a program that runs again every move (like a game loop), if and if-else decisions, nested ifs, the order of rules, not and and on a condition, and debugging. Kids also learn that a short program can handle situations they never planned for, and why it sometimes cannot.
By the ToolFluency team ยท Updated November 2026
Free coding game for kids 8-12: write the snake
How to use
- Pick a mission. The goal line says what to do: survive a number of moves, or eat a number of apples. You never steer the snake: your program does.
- Tap blocks to build the snake's brain. Every move the snake runs it once, top to bottom, and the first turn left, turn right or go straight it reaches is that move. If nothing is reached, it goes straight.
- Add an if and tap its check to choose what the snake looks at: wall, my tail or blocked (ahead, left or right), apple ahead, apple to my left or right, and left or right is closer to the apple.
- Press Run and watch. Use Step to go one move at a time: the checks light up yes or no, and the block that chose the move glows.
- If the snake crashes, it freezes on that move, the block that chose it glows pink and one line says why. Press Back 5 or drag the slider to replay the moves that led there.
- Aim for 3 stars: each mission shows the block count for 3 and 2 stars. Later worlds add not and and, which make a check say exactly what you mean without extra blocks.
- Turn on the code view to see the same brain written as text (if wall_ahead(): turn_right()), a first step toward languages like Python.
- Free Run: random apples on a big board. Your best score stays on this device; press New apples for a fresh board.
Frequently asked questions
What does my child actually learn?
Real programming ideas: a program that runs again every move (like a game loop), if and if-else decisions, nested ifs, the order of rules, not and and on a condition, and debugging. Kids also learn that a short program can handle situations they never planned for, and why it sometimes cannot.
How is this different from playing Snake?
Kids never steer. They write the rules first, then press Run and watch the snake follow them. If it crashes, the game freezes on that move, lights up the block that made the choice and says why, for example "Turned left into your own tail on move 31." Then they fix the rules.
Why turn left and turn right instead of arrows?
Every check and command is from the snake's own point of view: wall ahead, apple to my left, turn right. Kids have to imagine which way the snake is facing, the same spatial skill classroom floor robots train.
Can every mission really be won?
Yes. Every board is fixed (the apples come from a set seed, so a run always plays out the same way), and our checker runs a reference program on every mission to prove it wins. It also proves that the simpler program from the world before does not, so each mission needs its new idea.
What age is it for?
Ages 8 to 12. The first mission needs two blocks: if wall ahead, turn right. The last world asks for a snake that eats 25 apples without trapping itself. Younger children can start with Puppy Path, and Code Blocks is the robot coding game in the same style.
Is it free, and is anything shared?
Free, with no ads, no account and no uploads. Progress, stars, each mission's last program and the Free Run best score stay in the browser on this device.
Part of ToolFluencyโs library of free online tools for Kids. No account needed, no data leaves your device.