Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ CODE ARCADE

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.

Logo


Live Demo: code-arcade-psi.vercel.app


Quick start (Termux)

pkg install python          # only needed once
cd codearcade
python server.py

Then 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 port

Play 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:8080 address โ€” open that on a laptop or a friend's phone on the same Wi-Fi to play there too.


The games

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

Things that keep it interesting

  • 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.


Adding your own questions

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).


Files

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

Troubleshooting

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.

About

๐ŸŽฎ CODE ARCADE is an offline-first coding game collection that turns ๐Ÿ’ป programming concepts into โšก fast-paced mini-games. Instead of ๐Ÿ“š reading tutorials or solving endless exercises, you learn by ๐Ÿž spotting bugs, ๐Ÿ”ฎ predicting output, ๐Ÿงฉ rebuilding algorithms, ๐Ÿ”ข mastering binary, ๐ŸŽฏ writing regex, and โŒจ๏ธ typing real code under pressure.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages