HOW WANDER IS BUILT · LAYER 1 OF 7

A number is a column

The ruler sequence and the run ladder.

1. A number is a column2. A column is a height3. A window is a chunk4. A chunk is a mesh5. A mesh is a view6. A world has people7. A world has rules

Everything in Wander starts from one integer: the column number g. The ruler sequence gives every column a rank, v2(g+1), the number of times two divides g+1. A column of rank k comes every 2^k columns, so rank 4 is common, rank 12 is one in 4,096, and rank 24 happens once in sixteen million. The run ladder CUM[k] turns a rank into a height: it is the number of bits of rule 30's edge whose period divides 2^k, and it climbs 0, 1, 2, 3, 4, 5, 6, 12, 13, 21, … A hill, a city, a station, a prize: each stands on a column because of its rank, and each is as tall as the ladder says. Nothing is searched for. The next column of rank 9 after g is a rounding: ceil((g+1)/512)·512 − 1.

The twenty lines that make it

const R = RulerLand;                                   // ../../../sitoolz/js/rulerland.js (rangeblends.js before it)
const g0 = 2600000;
for (let g = g0; g < g0 + 64; g++){
  const k = R.v2(g + 1);                                // the rank of the column
  const hill = R.hillAt(g);                             // null unless the rank is 4 or more: {g, k, h, r}
  console.log(g, "rank", k, "ladder", R.CUM[Math.min(k, R.VMAX)], hill ? `hill ${hill.h} blocks, radius ${hill.r}` : "");
}
console.log("next rank-9 column:", Math.ceil((g0 + 1)/512)*512 - 1);   // found by rounding, not by looking

The Ruler Land page shows the same thing as ground: wander/land.html. The law is on cards/rulerland.md and the fixture fixtures/ruler-land.json checks 5,081 of its values between Python and JavaScript.

A column is a height →

How Wander is built · by Lars Rocha · every layer stands on a law in sitoolz, written twice and checked against one fixture.