Six coding mini-games in one web app, served from Termux on your phone. No internet, no npm, no pip โ just Python's standard library.
Live Demo: code-arcade-psi.vercel.app
pkg install python # only needed once
cd codearcade
python server.pyThen open http://localhost:8080 in Chrome/Firefox on the same phone.
Or use the launcher (also tries to open the browser for you):
chmod +x run.sh
./run.sh # ./run.sh 5000 for a different portPlay it like a real app: in Chrome tap โฎ โ Add to Home Screen. It installs as a PWA, runs full-screen, and works with Wi-Fi and data off.
The terminal also prints a
http://192.168.x.x:8080address โ open that on a laptop or a friend's phone on the same Wi-Fi to play there too.
| Game | What you do | What it teaches |
|---|---|---|
| ๐ Bug Hunter | Tap the line hiding the bug before the timer dies | Off-by-one, = vs ==, mutable defaults, scope, dangling pointers |
| ๐ฎ Output Oracle | Predict exactly what a snippet prints | Type coercion, integer division, float precision, operator order |
| ๐งฉ Stack Rebuild | Reorder scrambled lines (indentation counts) | Program structure: FizzBuzz โ binary search โ quicksort partition |
| ๐ข Binary Blaster | Flip 8 bits to hit the target before the fuse burns | Binary/hex conversion and bitwise AND OR XOR |
| ๐ฏ Regex Ranger | Write a pattern matching green strings, not red | Regex, live-highlighted, with a token keypad so you don't fight the keyboard |
| โจ๏ธ Terminal Typer | Type real code lines at speed | Symbol-heavy typing speed and accuracy |
- XP + levels โ every correct answer levels you up; level-ups pay coins and power-ups.
- Combos โ consecutive correct answers multiply your score (capped at ร8).
- Boss rounds โ every 10th question is worth 3ร on a tighter clock.
- Coins & Shop โ buy power-ups, unlock 5 themes (Neon, Matrix, Synthwave, Amber CRT, Paper).
- 24 badges โ from First Blood to Regex Golfer and Keyboard Ninja.
- Daily Gauntlet โ all six games chained into one run. Same puzzles for everyone that day (date-seeded), and clearing all six builds your ๐ฅ streak.
- Power-ups โ 50/50, Freeze (+time), Hint, Skip.
- Syllabus filter โ restrict content to Python / JavaScript / C / Java.
- Stats page โ accuracy, best WPM, high scores, time played, favourite game.
Progress saves automatically to browser storage. Settings โ Export save gives you a code you can paste into another device.
Everything lives in one file: public/js/data/bank.js. Add an entry and it
appears in rotation immediately โ no build step, just refresh.
// A new Bug Hunter snippet: `bug` is the 0-based index of the broken line.
{ lang:'py', diff:2, lines:[
'def total(nums):',
' s = 0',
' for n in nums:',
' s = n', // <- index 3
' return s'], bug:3,
why:'Should be <b>s += n</b>, otherwise it only keeps the last value.' },// A new Output Oracle question: `a` must be one of `opts`.
{ lang:'js', diff:1, code:['console.log(typeof null)'], a:'"object"',
opts:['"null"','"object"','"undefined"','"number"'],
why:'A famous JS bug kept for backwards compatibility.' },lang can be py, js, c, java, or uni (shows in every filter).
codearcade/
โโโ server.py stdlib-only web server
โโโ run.sh Termux launcher
โโโ PLAN.md the full design doc
โโโ public/
โโโ index.html all screens
โโโ sw.js offline cache
โโโ css/style.css
โโโ js/
โโโ core.js state, XP, badges, audio, particles
โโโ ui.js router, HUD, shop, the game Host
โโโ main.js boot + Daily Gauntlet
โโโ data/bank.js <-- your content
โโโ games/ one file per game
Port already in use โ python server.py 8081
Page won't load โ make sure you ran the command from inside the codearcade
folder (the one containing server.py).
Edits don't show up โ the server sends no-cache headers, but the PWA service worker may hold an old copy. Hard-refresh, or Settings โ clear site data.
No sound โ tap the screen once (browsers require a gesture before audio), and check Settings โ Sound effects.
Typing symbols is painful โ Termux's keyboard isn't needed here; use your normal keyboard, and turn off autocorrect for Terminal Typer.