How Block Jigsaw Generates a Puzzle
The generator does not scatter random shapes and hope they happen to fit. It starts with a complete square grid, divides that grid into connected regions, and turns each region into a draggable piece.
The core idea: partition a finished board
Suppose the selected mode uses an 8×8 board and ten pieces. The game first treats all 64 cells as a single complete area. It then chooses ten seed cells distributed around the grid. Each seed becomes the starting point for one future piece.
From there, unassigned cells are gradually claimed by neighboring regions. Because a region can only grow into an adjacent cell, every resulting piece remains connected rather than becoming a collection of unrelated squares.
How the seed positions are spread out
The first seed is random. Additional seeds are chosen with a preference for cells that are far from seeds already selected. Distance is measured across the grid, with a small random factor added so repeated puzzles do not follow exactly the same pattern.
This spacing helps avoid a situation where several future pieces all begin in one tiny corner while a huge untouched area is left elsewhere.
How regions grow
For each empty cell that touches an existing region, the generator considers assigning that cell to the neighboring region. The score includes several influences. Easier modes favor compact growth, while harder modes add more randomness so regions can become jagged and irregular. The generator also penalizes regions that are already large compared with the target average size.
This balancing is why Little Explorer tends to produce chunkier shapes while Master and Expert produce more awkward outlines. The exact shape is not selected from a fixed catalogue; it emerges from how the regions expand across the board.
Quality checks before a puzzle is accepted
The generator may reject an attempt and try again. In the current implementation, every region must meet the mode's minimum piece size, and no region is allowed to become excessively large compared with the average. These checks prevent tiny accidental fragments and help keep the set reasonably balanced.
The generator has a finite number of attempts. If it cannot produce a valid partition within that process, it reports an error and asks the player to try again rather than presenting a malformed board.
Why the puzzle starts with at least one solution
Once the complete board has been successfully partitioned, the game records the original row and column of each region. Those original positions together reconstruct the board because the pieces came directly from it. That original arrangement is also what the hint system can reference.
After generation, pieces may be rotated or flipped according to the selected mode before being shown in the tray. The player's challenge is to work out a legal complete arrangement. It may be the original one, but it does not have to be: if a different arrangement fills the board without overlap, the game accepts it too.
What “jaggedness” changes
Internally, each mode has a different irregularity setting. Low irregularity rewards a region for growing beside cells it already owns, which tends to make pieces compact. Higher irregularity gives random growth more influence, allowing longer arms, notches and less predictable boundaries.
That is one reason difficulty increases even before considering rotation or board size. More irregular outlines create more relationships between pieces and more ways to make a plausible placement that later turns out to be inconvenient.
Rotation and flipping are transformations of the same cells
A piece is stored as a set of grid-cell coordinates. Rotation transforms those coordinates in 90-degree steps and then normalizes them back to a top-left origin. Flipping mirrors the horizontal coordinate before normalization. The game checks the transformed cells against the board whenever the player tries to place, rotate or flip a piece.
Why this generation method suits Block Jigsaw
Starting from a finished board provides a clean guarantee that the generated set is coherent. It also supports fresh play: the game can create many layouts without storing a huge library of hand-authored solutions. At the same time, the mode settings let the generator shape the experience, from compact beginner-friendly regions to difficult asymmetric pieces.