Skip to main content

An endless banner

Reproducible, and any part can be made on its own

The banner has no last row. It is built from numbered motif slots, 0, 1, 2 and so on forever, and two rules keep it reproducible:

  1. The motif in slot k depends only on the seed and k. The computer derives a private random number generator from the pair (seed, k), so slot 1000 always gets the same motif, whether or not slots 0 to 999 were ever made.
  2. The stretch between slots k and k+1 depends only on those two motifs and its own sub-seed. Each stretch is filled independently. If filling gets stuck, it retries with the next sub-seed without touching the rest.

The border bands repeat with their own period, so they continue forever too. Together this means:

Every random choice in the code goes through one function, sub_rng(seed, stage, slot), which is what makes this work.

NoteRead more

Procedural generation · Random seed (both Wikipedia)