Block Dreamer: The Day a 711 KB File Beat Me 87,453 to 1,147
Description: I trained a neural network to play my block puzzle, squeezed it into 711 KB, and put it in your browser. It beat me 87,453 to 1,147. This is how I built it, and how I designed a game where you can watch a machine think.
It started as a Python puzzle game. Place blocks on an 8×8 board, clear rows and columns, don’t run out of room. Then I asked a question I couldn’t let go of: could a machine learn this game with nothing but the score?
No examples of good play. No rules about strategy. Just: here’s the board, here’s what you scored.
So I built it a world to practise in. An exact copy of the game rules, rewritten to run on a GPU, playing 4,096 games at the same time. I checked it move by move against the real game, so the machine was never learning a slightly wrong version of reality.
Then I gave it a way to think before it moves. I called it the dream. Before every move, it imagines every possible placement and measures what happens: lines cleared, points earned, how much of the future stays open. When it plays, it plans the whole hand of three pieces in different orders, then imagines random next hands to check its plan survives what comes after.
The real challenge wasn’t training it. It was putting it in your hands.
That shaped every decision:
No servers. The trained model is 711 KB. It runs in your browser through WebAssembly, in a background thread, so the board never stutters while the AI thinks.
Fair by design. You and the AI start from the same board and the same first hand. After that, you each draw your own pieces, so nobody can copy anybody.
Watch it think. The AI’s planned moves show as faint ghosts on its board, and its status says “Dreaming” while it searches. You’re not watching a black box; you’re watching a plan.
Difficulty that’s honest. Easy and Normal play on instinct and occasionally slip. Hard runs the full dream search. In testing, it averaged around 17,000 points a game.
Help for humans only. Hints use the full-strength AI, but only reveal your next move, with a 30-second cooldown. One undo and one reroll per game. The AI gets none of these.
Every board is a challenge. Each match has a link. Send it, and your friend plays your exact game.
The strangest part was watching it play moves I’d have called mistakes, then clearing five lines with them two turns later.
It’s a bunch of numbers. And it’s better at my game than I am.
If you’re building something with AI in it, especially something that needs to feel alive in the browser, I’d love to talk.