Fix a block-placing puzzle that clears a row but misses the column it finished too
One piece can finish a row and a column at the same moment, or be dragged half outside the board. Clear the row first and the column is broken, and an edge piece can place into nothing. This entry shows how to make the AI check placement strictly and clear everything finished at once.
Why this works
A completed line is a fact about the board at one moment. If you clear one line before you look for the others, you change the facts under your own feet. So look at the finished board first, write down every full line, and only then empty them all together.
When not to use it
Clearing everything at once is wrong in a game where cleared lines should shift the rest, such as falling blocks with gravity. There, the order of clearing changes the result, so decide it on purpose and test chains of clears, not only single ones.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- A diagram of every state
- 29 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Fix a block-placing puzzle that clears a row but misses the column it finished too" (read_entry block-placing-puzzle-line-clear-bugs) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP