@@ -1,5 +1,5 @@
3title: Examples
3title: Examples
@@ -82,14 +82,14 @@ up through the factors we're removing.
82Line `11`: we start a loop. The product of the loop is cast to
82Line `11`: we start a loop. The product of the loop is cast to
83`..main`, which is the core we're in (`+1.main`).
83`..main`, which is the core we're in (`+1.main`).
85−Lines `12` and `13`: we terminate the loop, returning `..main`,
85+Lines `12` and `13`: we terminate the loop, returning `..main`,
86if the square of the counter exceeds the range.
86if the square of the counter exceeds the range.
88Line `14`: repeats the loop, incrementing the counter, and
88Line `14`: repeats the loop, incrementing the counter, and
89replacing the core with a version sieved by `reap`.
89replacing the core with a version sieved by `reap`.
91Lines `16` and `17`: the `reap` arm, which produces a gate that
91Lines `16` and `17`: the `reap` arm, which produces a gate that
92−removes multiples of a factor from the field (set of possible
92+removes multiples of a factor from the field (set of possible
93primes). The sample of this gate is the factor to remove.
93primes). The sample of this gate is the factor to remove.
95Line `18`: we declare a variable `count`, an atom, with the
95Line `18`: we declare a variable `count`, an atom, with the
@@ -235,7 +235,7 @@ common pattern. (You could put the molds and the gates in the
235same core, but the compiler couldn't constant-fold gate samples
235same core, but the compiler couldn't constant-fold gate samples
236that use these molds, an efficiency cost.)
236that use these molds, an efficiency cost.)
238−Line `12` defines the `side` mold, an alias for `atom` (`@`).
238+Line `12` defines the `side` mold, an alias for `atom` (`@`).
239A side is a half of the board, as a marked/unmarked bitfield.
239A side is a half of the board, as a marked/unmarked bitfield.
241Line `13` defines the `spot` mold, a 2D coordinate.
241Line `13` defines the `spot` mold, a 2D coordinate.
@@ -246,7 +246,7 @@ output action), as a book (tagged union). There are two forms of
246(reporting that `'X'` or `'O'` won a game.
246(reporting that `'X'` or `'O'` won a game.
248Lines `17` to `20` define the `move` mold, a game move. This is
248Lines `17` to `20` define the `move` mold, a game move. This is
249−either `[%x spot]`, `[%o spot]`, or `[%z ~]` to reset the board.
249+either `[%x spot]`, `[%o spot]`, or `[%z ~]` to reset the board.
251Lines `21` to `23` define the `game` mold, the game state. This
251Lines `21` to `23` define the `game` mold, the game state. This
252is an `a` side, the next side to move; a `z` side, the other
252is an `a` side, the next side to move; a `z` side, the other
@@ -266,7 +266,7 @@ to a bit index.
267Line `31` is the `get` gate, which produces the bit at a `spot`.
267Line `31` is the `get` gate, which produces the bit at a `spot`.
269−Line `32` is the `set` gate, which produces a new side with the
269+Line `32` is the `set` gate, which produces a new side with the
270bit at a `spot` set. It works by ORing (`con`) `half` with the
270bit at a `spot` set. It works by ORing (`con`) `half` with the
271binary exponent (`bex`) of the offset (`off`) of the spot.
271binary exponent (`bex`) of the offset (`off`) of the spot.
@@ -331,7 +331,7 @@ side `z`, and replaces `z` with `next`.
331 ++ spot {x/@ y/@}
331 ++ spot {x/@ y/@}
332 ++ fact $% {$tie $~}
332 ++ fact $% {$tie $~}
333 {$win p/cord}
333 {$win p/cord}
335 ++ move $% {$x p/spot}
335 ++ move $% {$x p/spot}
336 {$o p/spot}
336 {$o p/spot}
@@ -358,8 +358,8 @@ side `z`, and replaces `z` with `next`.
358 |= act/move
358 |= act/move
359 ^- {(unit fact) game}
359 ^- {(unit fact) game}
361− {$x *} ?>(w.mag ~(mo on p.act))
361+ {$x *} ?>(w.mag ~(mo on p.act))
362− {$o *} ?<(w.mag ~(mo on p.act))
362+ {$o *} ?<(w.mag ~(mo on p.act))
363 {$z *} [~ nu]
363 {$z *} [~ nu]
@@ -376,7 +376,7 @@ side `z`, and replaces `z` with `next`.
376 ?: ~(win bo next)
376 ?: ~(win bo next)
377 [[~ %win ?:(w.mag %x %o)] nu]
377 [[~ %win ?:(w.mag %x %o)] nu]
378 [~ mag(w !w.mag, a z.mag, z next)]
378 [~ mag(w !w.mag, a z.mag, z next)]