| name | sieve-render |
| description | Private sieve subskill. Invoked by the sieve controller after each pass; not user-invocable. Reads sieve.state and draws the current grid — remaining primes vs. struck (composite) numbers. |
| user-invocable | false |
Sieve render — draw the current grid
You are a private subskill (user-invocable: false), invoked by the sieve
controller to visualize the current state. You take no meaningful argument.
Do exactly this:
-
Read sieve.state:
n from the n=<n> header line.
- The struck set = the union of every number on the right-hand side of all
strike p=... -> ... lines.
- The last pivot = the
p from the most recent strike line, if any.
-
Draw a grid of 1..n in a fenced code block, 10 numbers per row, each cell
right-aligned to width 4:
1 → render as · (1 is not prime).
- A struck number → render as
· (composite).
- Any other number (still unmarked, so prime-so-far) → render the number, e.g.
7.
Example shape for n=30 after striking 2, 3, and 5:
· 2 3 · 5 · 7 · · ·
11 · 13 · · · 17 · 19 ·
· · 23 · · · · · 29 ·
-
Below the grid, print a one-line legend and status:
legend: number = prime so far, · = struck/not prime — and, if there was a
last pivot, add (just struck multiples of <last pivot>).
Do not modify sieve.state, strike anything, or invoke other skills. Render
only, then return control to the controller.