amog.fun∘
cgt : Games → {+, −, 0, ∥}

CGT Playground

Combinatorial game theory, hands on. Every game here is a pair of option sets $\{L \mid R\}$: Left moves to one of $L$, Right to one of $R$, and whoever can't move loses. Build games, drag them onto the field to play their sum, and let Amog sort out who wins and how they compare.

Library

Sorted by outcome; games in one box are equal (same canonical form, shown on top). Drag a game onto the field, or click it for more.

Define a game

options: {0, * | 1} · nested: {0 || 0 | -1} · sums: up + star · negation: -hot, a - b
numbers 3 -1/2 0.75 · nimbers * *3 nim(5) · ^ ^^ v · ±1 · 1* (= 1 + *) · Domineering dom(3, 4) (Left vertical) · names from the library

Playground

Drag games here to add them up. Each move happens inside one game: blue for Left, red for Right.
turns first

    Relations

    The row game compared with the column game, from the sign of their difference: > (row − column is positive), <, = or ∥ (confused: fuzzy). Click a ? to think harder.

    How Amog reads a game

    \begin{definition}Under normal play a game $G$ falls into one of four outcome classes: positive ($G > 0$: Left wins whoever starts), negative ($G < 0$: Right wins), zero ($G = 0$: the second player wins) and fuzzy ($G \parallel 0$: the first player wins).\end{definition}

    \begin{definition}$G \le H$ when no Left option $G^L$ has $G^L \ge H$ and no Right option $H^R$ has $H^R \le G$. Then $G \ge 0$ means Left wins when Right starts, and $G \le 0$ means Right wins when Left starts.\end{definition}

    Sums: in $G + H$ you move in exactly one component, so $G + H = \{G^L + H, G + H^L \mid G^R + H, G + H^R\}$. Negation swaps the players, $-G = \{-G^R \mid -G^L\}$, and comparing $G$ with $H$ is the same as asking for the outcome of $G - H$: that's how the relations table is filled in.

    \begin{theorem}[Canonical form]Every short game equals a unique simplest game, found by deleting dominated options (a Left option no bigger than another; dually for Right) and bypassing reversible ones (a Left option $A$ with some $A^R \le G$ gets replaced by $A^R$'s Left options; dually for Right).\end{theorem}

    So two games are equal exactly when their canonical forms agree, which is how the library boxes them. Amog names the familiar ones: numbers like $\tfrac34 = \{\tfrac12 \mid 1\}$, nimbers $*n$ (from Nim), $\uparrow = \{0 \mid *\}$ and its multiples, $\pm x = \{x \mid -x\}$, tiny and miny, and sums like $1*$. Everything else prints as nested braces.

    \begin{example}$\uparrow$ is positive, yet smaller than every positive number, and confused with $*$: $\uparrow \parallel *$ but $\uparrow + * = \{0, * \mid 0\}$ is fuzzy while $\uparrow + \uparrow + * = \{0 \mid \uparrow\}$ is positive. Drag them onto the field and see.\end{example}

    Amog only does a quick search by default, so huge sums may show a ?. "Think harder" runs a longer search in the background, for up to a minute, on that game or relation.