Q-learning beats Flappy Bird, one crash at a time
A browser-based reinforcement learning demo that teaches a bird to fly by dying repeatedly.

What it does This is a JavaScript implementation of Flappy Bird where a Q-learning agent plays the game instead of you. The agent learns when to flap by accumulating experience through failure—lots of failure. You run it locally in a browser and watch the bird gradually stop hitting pipes.
The interesting bit The whole thing runs client-side in a browser with no training infrastructure, no GPUs, no Python dependencies beyond a one-line HTTP server to dodge CORS restrictions. It’s reinforcement learning stripped to its essentials: state, action, reward, repeat until the bird survives longer than your patience.
Key highlights
- Pure JavaScript implementation of Q-learning
- Visual demo and algorithm summary hosted on GitHub Pages
- Requires only Python’s built-in
SimpleHTTPServerto run locally - Includes troubleshooting for the classic “I opened index.html directly and nothing works” CORS gotcha
- ~920 stars suggest the “watch AI learn from scratch” novelty still lands
Caveats
- README is sparse: no mention of state space design, reward function details, or convergence behavior
- The “algorithm summary” link is the only documentation beyond setup instructions
- No code comments or architecture explanation visible in the provided source
Verdict Grab this if you want a minimal, visual introduction to Q-learning for students or skeptics. Skip it if you need a rigorous benchmark, reproducible experiments, or anything beyond “bird go up, bird learn not go splat.”