Falling Blocks Placement Solver

Find the best spot for a falling four-cell piece on any board, with optional lookahead.

Width 4–20 cells, height 4–40 rows. Pixelpier’s Blockfall deck is 11 × 21. Any character other than “.” or a space counts as filled.

More options

Try an example: ·

More about this tool

Part of Pixelpier

How it works

Paste a falling-blocks board as rows of “.” and “#”, pick the current piece (I, O, T, S, Z, J or L) and optionally the next one. The solver tries every rotation and column the piece can be dropped into, scores each resulting board by height, holes, transitions and wells, and returns the best placement with the board after it, cleared rows and the runner-up placements. It is the same function that powers the hint and the demo player in Pixelpier’s Blockfall.

  • Pieces use their spawn orientation as rotation 0; rotations 1–3 are quarter turns clockwise inside the piece’s box (4 × 4 for I, 2 × 2 for O, 3 × 3 for the others).
  • Placements: every rotation and column from which the piece can fall straight down from the top of the board. Slides under overhangs and twist moves are not searched.
  • Each placement is scored on the board after it (rows cleared first) with Dellacherie’s features — landing height, eroded piece cells, row and column transitions, holes and well depths — weighted as in El-Ashi (2011), rounded. With a next piece, the score is the average of this placement and the best placement of the next piece after it.
  • “column” is the leftmost column the piece covers and “landingRow” its top row, both counted from 0 at the top-left. Ties go to fewer rotations, then to the left.

A heuristic, not a proof of the optimal move: it looks at most one piece ahead.

Sources

Part of Pixelpier

  • Pixelpier Arcade game hall

    Eight classic-style arcade games on a neon pier, from falling crystals to a reef maze.

    Open Pixelpier

How to use the Falling Blocks Placement Solver

Paste a falling-blocks board, pick the piece and get the best column and turn, the rows it clears and the runner-up moves.

What it is for

The Falling Blocks Placement Solver answers one question: where should this piece go? You paste a board as rows of . (empty) and # (filled), choose the falling piece — I, O, T, S, Z, J or L — and, if you know it, the next one. The solver tries every turn and every column the piece can fall straight into, scores the board that would result and tells you the best spot, how many rows it clears and what the board looks like afterwards.

It is the same function that draws the hint and plays the demo games in Pixelpier's Blockfall, so you can use it to understand why the hint suggests a move, to study your own games or to test a bot of your own.

Worked example

Open the first example, Long piece into a deep well: an 11 × 21 board (the size of Pixelpier's deck) whose four bottom rows are full except column 5, with two extra cells at the right. Piece I, no next piece.

The answer: drop the I piece one turn right with its left edge in column 5; it lands on row 18 and clears 4 rows. The board after the move is empty except the two cells that were above the well. The runner-up moves lay the piece flat on top and clear nothing — they score much lower.

The second example, T piece with the next piece known, uses a small 6 × 6 board with the rows #..### and ##.### at the bottom. With an O piece coming next, the solver turns the T one turn left, drops it with its left edge in column 2 onto row 4 and clears 2 rows, leaving a single cell behind.

How to read the result

  • Rotation: spawn position, one turn right, half turn or one turn left (0–3 in the JSON).
  • Column is the leftmost column the piece covers, row its top row; the summary and table count from 1, the JSON result from 0 at the top left.
  • Score is the solver's rating of the board after the move. It is only useful for comparing moves on the same board — higher is better, the absolute number has no meaning.
  • Runner-up placements list the next-best moves, so you can see how close the decision was.

How the solver decides: it looks at the board after the move (with full rows removed) and adds up six measures known from falling-blocks bots since Pierre Dellacherie's work: how high the piece lands, how many of its own cells disappear in cleared rows, how often filled and empty cells alternate along rows and columns, covered holes and deep wells. The weights follow Islam El-Ashi's tuned values, rounded. With a next piece, each move is rated by the average of its own score and the best score the next piece can reach afterwards.

Tips and common mistakes

  • Only straight drops from the top are considered. Sliding a piece sideways under an overhang or twisting it into a gap is possible in the game but not searched here.
  • Any character other than . or a space counts as filled, so you can paste boards that use letters for colours.
  • Boards can be 4–20 cells wide and 4–40 rows high; empty rows at the top matter only if your piece would not fit otherwise.
  • "No placement fits" means the piece cannot enter the board anywhere — the game would be over.

FAQ

Is the suggested move always the best one?

No. The solver is a fast heuristic that looks at most one piece ahead. Strong players sometimes keep a well open longer or plan several pieces ahead; the solver does not.

Does it work for other falling-blocks games?

For any game with the seven four-cell pieces and straight drops, yes. Spawn positions and wall kicks differ between games, which the solver does not need because it only looks at where a piece ends up.

Can I use it while playing Blockfall?

Yes, without leaving the game: switch on Show the best spot for the falling crystal in Pixelpier's Settings. A dashed outline on the deck then shows the solver's move for the current crystal and the next one.

Guide last updated:

For scripts and AI agents

  • JSON API: POST https://pixelpierblockfallsolver.usefulweb.app/api/v1/calculate (same calculation as this page)
  • Interface description: OpenAPI 3.1 · AI guide: llms.txt
  • MCP server (Streamable HTTP): https://pixelpierblockfallsolver.usefulweb.app/mcp · tool name pixelpier_blockfall_solver
Example request
curl -s -X POST https://pixelpierblockfallsolver.usefulweb.app/api/v1/calculate \
  -H 'content-type: application/json' \
  -d '{"board":"...........\n...........\n...........\n...........\n...........\n...........\n...........\n...........\n...........\n...........\n...........\n...........\n...........\n...........\n...........\n...........\n.........##\n####.######\n####.######\n####.######\n####.######","piece":"I","next":"","alternatives":5}'
Feedback · ideas & bug reports welcome