← the explorer · read it back · forward: π → floorplan

Build the mosaic one number at a time.

A fixed final canvas keeps the rectangulation stable while each permutation entry creates a top-right block, splits the active block, and extends a boundary when the neighboring labels allow it.

construction canvas

Starting block

startframe 1 / 1finished

Start with the first number as one rectangle. The latest block created is the active block—the current top-right block.

  1. Let a be the active block and b the incoming number.
  2. If b < a, split horizontally and place b in the top block.
  3. If b > a, split vertically and place b in the right block.
  4. After a horizontal split, extend b left while each neighboring block is larger than b.
  5. After a vertical split, extend b down while each neighboring block is smaller than b.

Each extension stops at the canvas boundary or at a blocking block: a left neighbor ≤ b, or a block below ≥ b.