# Light Cone 2: how it is built

A tutorial page and a forge: choose the drivers, depth, unit, gap and phase, watch the faces build from the kit, open the same walls in Wander.

## What it imports

```html
<script src="../../../sitoolz/js/rangeblends.js"></script>
<script src="../../../sitoolz/js/rulerland.js"></script>
```

From `RulerLand`: `coneColumn(g, depth, driver)` (the bits of column `g` from the ground up: the run, a zero, then `depth` bits of lace), `coneRun(g, driver)`, `coneSpans(g, depth, unit, driver)` (the same column as `[y0, y1]` block spans, what Wander stacks), `conePeriod(y, driver)` (the exact period of bit `y`), `CONE_DRIVERS` (or, xor, comb).

## The twenty lines that make it

```js
const R = RulerLand, driver = "or", g0 = 0, depth = 14, cols = 256;
const columns = Array.from({length: cols}, (_, i) => R.coneColumn(g0 + i, depth, driver));   // 1 is stone
const top = Math.max(...columns.map(c => c.length)), cw = 4, ch = 6, g = canvas.getContext("2d");
for (let i = 0; i < cols; i++){ const run = R.coneRun(g0 + i, driver);
  columns[i].forEach((bit, y) => { if (bit){ g.fillStyle = y < run ? "#9a9ab0" : "#d8c48a"; g.fillRect(i*cw, canvas.height - (y + 1)*ch, cw - 1, ch - 1); } }); }
const link = "https://rangeblendz.netlify.app/wander/?" + new URLSearchParams({world: "lightcone2", walls: "or,xor,comb", depth, unit: 2, gap: 240, phase: g0, hours: 9, flyover: 1});
```

Wander's Light Cone 2 reads `walls`, `depth`, `unit`, `gap` and `phase` from the link, bakes one wall per driver from the same `coneSpans`, and offsets each wall's phase by 2^20 so the three show three stretches of the same tape.

## How to change the law

- `driver`: `or` is rule 30's edge, `E ← E ^ ((E<<1) | (E<<2))`; `xor` and `comb` are two other triangular XOR systems with the same run law and different lace. `RulerLand.CONE_DRIVERS` lists them.
- `depth`: how many bits of lace above the run are drawn; the tables are verified to bit 42 (`RulerLand.CONE_JMAX`), so a column of rank 12 (run 34) shows at most eight bits of lace whatever you ask.
- `unit`: blocks per bit in Wander; `gap`: cells between walls; `phase`: the first generation. A phase of `2^20·k` puts the wall on the same columns Wander's k-th wall uses.
- To add a driver: a new register recurrence in `rulerland.py`'s cone tables, its measured period per bit, the JavaScript twin, and a fixture row (`cards/HOW_TO_ADD_A_LAW.md`).

## How to verify it

`sitoolz/fixtures/ruler-land.json` holds the cone: 96 columns of bits, eight far generations to 2^40 and five deep ones for every driver, written by `prefixlaw.py` / `rulerland.py` and checked by `tests/twins.test.cjs`; `RulerLand.conePeriod(y)` must equal `2^p(y)` from `prefixlaw.SPECTRUM`. `smoke.cjs` here checks the page against three of those periods (32, 64, 256 at bits 8, 12, 20) and that the link carries the knobs.

## What was missing

Nothing.

![](shot.png)
