Solver for block puzzles