DEV Community

michal
michal

Posted on Edited on

I Built a Solver That Reads Block Blast Screenshots and Plans the Best Moves

Like a lot of people, I got hooked on Block Blast — and kept dying on boards that looked totally winnable. So I built a solver for it.
The idea is simple: upload a screenshot of your game, and the solver reads the board for you, then shows the best move for each of your 3 pieces, step by step.
Try it live: https://blockblastsolversi.com
Here's how it works.
Two problems, not one

  1. Vision. A screenshot has to become data: an exact 8×8 board plus the shapes of the 3 pieces in the tray.
  2. Search. Given that board, try the placements for all 3 pieces and keep the sequence that leaves the board healthiest. Reading the board with Python The screenshot analysis runs on a small FastAPI service: Find the board area in the image and split it into an 8×8 grid Classify each cell (filled / empty) by sampling colors near the cell center Extract the tray pieces the same way, as mini shape grids Themes and skins change the block colors, so fixed RGB matching failed constantly. Comparing relative color differences instead fixed most of it — on 71 real test screenshots, board-cell detection lands around 99% accuracy. Planning the moves Once the board is data, the search is straightforward: Generate every legal placement for piece 1, 2 and 3 Simulate the game's line clears (rows + columns) after each sequence Score the final board: reward clears and combos, punish rough surfaces, trapped holes and clutter The search runs in the browser, so the scoring function has to be cheap and bad branches get pruned early. The result feels instant, even on a phone. Stack Next.js + TypeScript on the front end (search runs client-side) Python + FastAPI for screenshot analysis Capacitor wrapper for the Android app Links

Live solver: https://blockblastsolversi.com
GitHub showcase: https://github.com/buzdarama/block-blast-solver
If you've built board-evaluation heuristics for puzzle games before, I'd genuinely like to hear how you scored "future flexibility" — that's the part I keep tweaking.
 ]
GitHub showcase: https://github.com/buzdarama/block-blast-solver
If you've built board-evaluation heuristics for puzzle games before, I'd genuinely like to hear how you scored "future flexibility" — that's the part I keep tweaking.

Top comments (0)