How this site is made

The figure library

Every picture here is generated from code at build time. This page lists the generators, each rendered at its defaults.

No figure on this site is a drawing that was made once and saved. Each one is a function: it takes parameters and returns SVG, so the same generator produces the 27° incline and the 5° incline without either being redrawn.

That is the reason the collection can keep growing without the illustrations drifting apart. A generator is written once, checked once, and every essay that calls it inherits the same line weights, the same colour roles, and the same behaviour in dark mode. There are 32 of them so far.

birthday-tree

The numbers, by the day they are bornZero on the first day, ±1 on the second, and thereafter the simplest number in each remaining gap. Every number reachable in finitely many days is a fraction with a power of two underneath, and every such fraction appears — which is a strange thing for a construction with no arithmetic in it to produce.day 00day 1-11day 2-2−1/21/22day 3-3−3/2−3/4−1/41/43/43/23each new number is the simplest one in a gap — which is the simplicity rule, applied everywhere at once

canonical-form

The same game, written twiceA position with an option no player would ever take, and the same position with it removed. Left would never move to −1 when 0 is available, so the option is dominated and can go. The two games are equal — verified, not asserted — and the second is the canonical form.as it arises1/201{0 | 1}dominatedoption removedcanonical1/201{0 | 1}both are worth 1/2and every game has exactly one canonical form, which is why values can be compared at all

comparison

Comparing two positions is playing their differenceTo decide whether one position is worth at least another, subtract and see who wins moving second. It is the only definition of comparison the subject has, and it produces a partial order — some pairs come out confused, which no comparison of numbers ever does.↑ − 0= ↑outcome L↑ > 0∗ − 0= ∗outcome N∗ ‖ 0⇑ − ↑= ↑outcome L⇑ > ↑1/2 − 1/4= 1/4outcome L1/2 > 1/4↑∗ − ∗= ↑outcome L↑∗ > ∗the differencethe verdict‖ means confused: neither greater, nor smaller, nor equal — and no amount of care removes it

domineering

Domineering on 2 by 3Left places vertical dominoes, Right horizontal ones, and a player who cannot place loses. The two players see different games on the same board, which is what partizan means — and the value that results is not a number.the boardworth 2 | −1/2outcome N{2 | −1/2}Left plays verticallyRight plays horizontally

domineering-values

Small Domineering boards and what they are worthEvery value here was computed from the moves rather than looked up. Even on boards this small the values are switches and infinitesimals rather than numbers, which is the ordinary situation for a partizan game and the reason the theory needs more than arithmetic.1×2-1R2×21 | -1N2×32 | −1/2N3×31 | -1NLeft plays vertically, Right horizontally

four-outcomes

Four things a position can beEvery position falls into one of four outcome classes, and only three of them correspond to a comparison with zero. The fourth — first player wins — is a position confused with zero, neither greater, smaller nor equal, and it is where the subject departs from arithmetic.0outcome P= 0whoever must move, loses10outcome L> 0Left wins, whoever starts-10outcome R< 0Right wins, whoever starts00outcome N‖ 0whoever moves first, winsblue edges are Left's moves, red are Right'sthree of the four are comparisons with zero; the fourth is not

green-edges

A green edge is not a numberGreen edges may be cut by either player, which makes the position impartial in that part. A single green edge is worth ∗ — a value that is neither positive, negative nor zero, and which no number can equal.not a numberoutcome N∗2not a numberoutcome N{1 | 1}not a numberoutcome L↑∗not a numberoutcome Ngreen may be cut by either playerand that is enough to leave the number line

grundy-strip

Grundy values for subtraction of 1, 2, 3The Grundy value of every heap size for a subtraction game, computed by the mex rule. Subtraction games are eventually periodic — always, by a theorem — and the period here was found by searching the computed sequence rather than assumed.001230412308123012123016123020123024heap size, and the value of a heap that bigperiod 4, from heap 0a heap of size n is worth ∗g(n) — and the whole game is the nim-sum of its heaps

hackenbush-line

Which numbers the strings reachEvery blue-red Hackenbush string of up to four edges, placed at its value. Short strings give integers, longer ones fill in halves and quarters, and the pattern continues — the reachable values are exactly the dyadic rationals, and nothing else.-2-1012121/2-1−1/2-21234edgesone more edge halves the gap — and every value is a fraction with a power of two underneath

hackenbush-numbers

The picture is the numeralBlue-red Hackenbush strings and their values. Left may cut a blue edge, Right a red one, and everything above the cut falls. The value of each string is a number, and reading the string from the ground upward gives the binary expansion of exactly that number.1blue2blue blue1/2blue red3/4blue red blue1/4blue red red3/8blue red red blueeach string is worth a number, and the string spells itblue is Left · red is Right · the ground is what holds it up

hackenbush-options

The value of LRL is computed, not readOne string with every option drawn. Left's moves are the blue edges she may cut, Right's the red ones; each leaves the part of the string still standing. The value follows from those options by the same recursion that defines every game in the subject.3/4the positionLeft cuts blue, leaving01/2Right cuts red, leaving1{1/2 | 1}

how-hard

Which questions are answerableThe theory is exact and much of it is expensive. Values are computable by definition; computing one for a position of any size is a different matter, and deciding the winner of a generalised board game is complete for PSPACE — as hard as anything solvable in polynomial space.the value of a Nim positioninstantthe Grundy value of a small subtraction gamelinearthe canonical form of a moderate positionexponential in theorywho wins a general Domineering boardno efficient methodwho wins a generalised board gamePSPACE-completecostthe definitions are constructive, so everything here is computable in principleand the practical range of an exact evaluator is a few dozen moves, which is the working constraint

infinitesimals

Smaller than every positive number, and not zeroValues that sit between zero and every positive number. Up is genuinely greater than zero — Left wins it whoever moves — and genuinely less than a thousandth. Star is not comparable with zero at all. None of them is a number, and in a close game they are the entire margin.{0 | {0 | 0}}> 0< 1/1024outcome L{0 | {{0 | 0}, 0 | 0}}> 0< 1/1024outcome L↑∗{{0 | 0}, 0 | 0}‖ 0< 1/1024outcome N{0 | 0}‖ 0< 1/1024outcome N{{0 | 0} | 0}< 0< 1/1024outcome Rvaluecanonical formagainst 0against a thousandth↑ is positive and smaller than every positive number — which no real number is∗ is none of greater, smaller or equal — the order is partial, and that is the point

loopy

A position that comes backThree positions whose moves lead round in a circle. Every value in this subject is defined by recursion on the options, and that recursion assumes play ends — here it need not, so the definition has nothing to stand on and the outcome may be a draw, which normal-play theory has no name for.ABCthe moves lead back to where they startedno base case, so the recursion never bottoms outa third outcome appears: neither player can force a winloopy game theory is a separate subject with separate machinery

mex-rule

The smallest one missingThe Grundy value of a position is the least non-negative integer that is not the Grundy value of any option. That single rule turns any impartial game into a Nim heap, because a heap of that size has exactly the same set of reachable values.012345the values the options havethe smallest missing one is 2so this position is worth ∗2options: 0, 1, 3, 4present · absent — and the first absent one is the answer

misere-breaks-it

What reversing the ending destroysEverything that makes normal play tractable is a theorem about who moves last, and misère play contradicts every one of them. The positions are unchanged; the machinery for evaluating them is gone, and what replaces it is far heavier.normal playmisère playevery impartial position is a Nim heapno such reduction existsequal games can be swapped in any sumonly within a restricted universethe value is a single small integeran element of a quotient monoida canonical form exists and is uniquecanonical forms are enormousthe game is what mattersthe game is what mattersmisère quotients recover some of it, one game at a timeand there is no general theory, which after fifty years is a real result rather than a gap

misere-nim

The same game, the opposite endingNim under normal play, where the player who cannot move loses, and under misère play, where they win. The positions are identical and only one class of them changes hands — which makes misère Nim look easy and is deeply misleading about misère play in general.heapsnormalmisère1, 1, 1NPthe answer flips1, 2, 3PPunchanged1, 1, 1, 1PNthe answer flips2, 2PPunchanged1, 1, 5NNunchangedmisère Nim differs only when every heap has one counterwhich is a special property of Nim, and not a feature of misère play at all

nim-heaps

Nim with heaps of 3, 5, 7Heaps of counters; a move takes any number from one heap. The position is a loss for the player to move exactly when the binary digits of the heap sizes cancel in every column — the nim-sum — and that is the whole of the theory of Nim.301151017111nim-sum001= 1some column does notthe player to move winstake 1 from the heap of 3outcome N

nim-sum

Adding without carryingThe nim-sum of the heap sizes: write them in binary and add each column separately, discarding any carry. A column with an even number of ones cancels. The position is lost for the player to move exactly when every column cancels.3011510171111001not zeroeach column on its own — a carry would ruin itso whoever moves next, wins

outcomes-do-not-add

Knowing who wins is not enoughThree pairs of positions, every one of which is a first-player win on its own. Their sums are not all the same, and not all in the same outcome class — so the outcome of a sum cannot be worked out from the outcomes of its parts, and that is why the theory needs values.∗ + ∗N + N0outcome P∗ + ∗2N + N∗3outcome N↑∗ + ↑∗N + Noutcome Leach part is a first-player winthe sumsame outcome classes going in, different outcomes coming outso a position has to be given a value, not merely a winner

play-domineering

Domineering on 3×4 — and who winsA Domineering board with the outcome stated before anybody moves. Left places vertically, Right horizontally, and on this board Right wins whoever starts. Every reply the machine can make was computed at build time from the game recursion, so it is following the analysis rather than searching.worth −3/2Right wins whoever movesstated before a move is madeyou place vertically · it places horizontallywith the script running, the vertical pairs become clickable and this claim can be tested

play-hackenbush

Hackenbush from LLRL and RRRL — and who winsTwo Hackenbush stalks with the total stated before anybody moves. Left cuts blue, Right cuts red, and everything no longer joined to the ground falls off. The total is negative, so Right wins whoever starts, and every reply the machine makes was computed at build time from the same recursion the essays describe.the total is −3/4Right wins whoever movesstated before a move is madeyou cut blue · it cuts redwith the script running, the blue edges become clickable and this claim can be tested

play-nim

Nim from 1, 2, 3 — and who winsA Nim position with the outcome stated before anybody moves. The reply to every move a reader can make was computed in advance from the nim-sum, so the machine is not searching or guessing — it is following the theorem, and there is no line of play in which it loses.123nim-sum 0the player to move losesstated before a move is madewith the script running, the heaps become clickable and this claim can be tested

play-the-hottest

Move where it is hottestFour independent components of one position, ordered by temperature. The temperature is how much a player loses by moving somewhere else instead, so the hottest component is the one to take — and a component that is already a number has no temperature at all, because nobody gains by moving in it.{6 | 0}t = 3a big fight{2 | 0}t = 1a smaller one{1 | 0}t = 1/2small change{0 | 1}no temperaturesettled — a numbercomponenthow much is at stakethe whole position is worth {{{19/2 | 17/2} | {15/2 | 13/2}} | {{7/2 | 5/2} | {3/2 | 1/2}}}and the first move goes in the hottest part, which is a theorem up to a small error rather than a rule of thumb

play-toads

Toads and Frogs on T.FT.F — and who winsA Toads and Frogs strip with the outcome stated before anybody moves. Toads move right, frogs left, and either may jump one opposing piece into an empty square. The position is worth zero, so whoever moves first loses — and every reply the machine makes was computed at build time.worth 0whoever moves first losesyou move the toads · it moves the frogswith the script running, the toads become clickable and this claim can be tested

same-value

Two positions, one valueA Hackenbush sprig and an abstract game with the same value. Being equal means more than being worth the same in isolation: either can be substituted for the other inside any larger position, and nothing about who wins will change.1/2a blue edge with a red one above=verified, not asserted{0 | 1}1/2the number one halfequal means interchangeable in every sum, which is a much stronger claimtheir difference is 0, and its outcome is P

simplicity

The simplest number in betweenA game whose options are numbers is worth the simplest number strictly between them — and simplest means born earliest, so integers come before halves and halves before quarters. It is not the midpoint, and the difference is the whole content of the rule.011/2{0 | 1}021{0 | 2}-550{-5 | 5}1/43/41/2{1/4 | 3/4}13/25/4{1 | 3/2}the marked point is the value; the hollow one, where it differs, is the midpoint

sprague-grundy

Every impartial position is a Nim heapA heap in a subtraction game, its Grundy value, and the Nim heap it is equivalent to. The equivalence is exact: the two positions have the same options up to value, so they behave identically in any sum, which is the Sprague–Grundy theorem.a heap of 10, taking 1, 3, 4options lead to heaps of 9, 7, 6whose values are 0, 0, 2mex of those is 1plays exactly likea Nim heap of 1= ∗the value is the heap size — nothing else about the position survives

sum-of-parts

A position is the sum of its partsFour separate Hackenbush sprigs. A move is a move in one of them, so the position is their disjunctive sum, and its value is the sum of their values. Which part to play in is the entire decision, and the values are what makes it decidable.2+-1+1/4+={5/4 | 5/4}outcome Leach sprig is a separate game; a move is a move in one of themthe total was computed by adding the games, not the labels

thermograph

The thermograph of {5 | 1}Temperature runs up the page and value across it. Each wall is where a player is willing to move once a tax of that much is charged per move; above the temperature at which they meet, neither wants to move and the position is worth its mean value. The height of the meeting point is what is at stake.012345601234valuetemperaturetemperature 2mean 3Left's wallRight's wall{5 | 1} — mean 3, temperature 2

thermograph-pair

What a deeper position does to the shapeTwo thermographs. The first is a simple switch and its walls are straight; the second has an option that is itself a fight, and the wall bends where that inner fight cools out. Every bend in a thermograph is a decision changing hands.24012345{4 | 0}temperature 2 · mean 224012345{4 | {2|0}}temperature 3/2 · mean 5/2

toads-and-frogs

Toads and frogsToads move right and frogs move left, one square into a gap or hopping over exactly one opponent. A player unable to move loses. It can be played on squared paper by anybody, and its values are immediately stranger than the game looks.NN0PNblue toads move right · red frogs move leftevery value came out of the moves; none was chosen