,---.| | |
|---|| ,---.,---.|---.,---.,---.,---.,---.,---.,---|,---.
| || | ||---'| || ,---|| | || || |,---|
` '`---'`---|`---'`---'` `---^`---'`---'` '`---'`---^
`---'
A browser-based Snake game where you slither through a grid collecting numbers and operators to hit a target value.
Navigate a hungry serpent through a grid of numbers and operators, collecting the pieces needed to build an equation that matches the Magic Number.
Unlike traditional Snake, success isn't measured by length alone — every move is a mathematical decision.
Each round presents a Magic Number (the target) and a board scattered with numbers and operators (+ − × ÷). Guide the snake to collect them and build a running equation that hits the target exactly.
The moment your equation equals the Magic Number, it auto-scores and a new round begins.
Example — Target: 24
Collect 6, then ×, then 4 → 6 × 4 = 24 ✓
- Collect a number, an operator, a number… to build a running total.
- Only your latest number and operator count — eat a better one to replace it.
- Hitting a wall wraps the snake to the opposite side — no penalty.
- Biting your own tail or letting the clock expire costs a life.
- Three lives per run.
| Biome | Unlocks at | New tools |
|---|---|---|
| 🌿 Garden | Start | + − × ÷ |
| 🌌 Twilight | 100 pts | Parentheses ( ) · Eraser |
| 🔥 Inferno | 250 pts | Bigger targets · blazing speed |
Speed increases with every solve and drops on a miss.
| Category | Details |
|---|---|
| Language | Vanilla JavaScript (ES2020+, ES Modules) |
| Rendering | HTML · CSS (no framework) |
| Runtime | Bun — dev server and test runner |
| Tests | bun:test |
| Container | Docker |
With Bun — requires Bun:
bun server.jsWith Docker:
make run # builds the image and starts the container
make stop # stop and remove the containerOpen http://localhost:3000.
bun test
# or
make test- End-to-end tests (Playwright)
- App versioning and release manifest
- CI/CD pipeline (GitHub Actions — run tests, build and push image to Docker Hub; release triggered on merge to
main) - Custom favicon
- PWA support
- Rethink layout for larger screens — current design is mobile-first and feels cramped on desktop
- Wall wrapping — hitting a wall teleports the snake to the opposite side instead of costing a life
This project draws inspiration from:
- Classic Snake and its simple, highly replayable gameplay loop
- Des Chiffres et des Lettres (specifically the numbers round), where players combine arithmetic operations to reach a target value
- Mental arithmetic and number-puzzle games that reward pattern recognition, strategy, and quick thinking