programdemos/tttml.xtl

TTTML: a machine that learns tic-tac-toe by playing itself, from the TTTML library (lib/TTTML.xtl, ported from sw-apl's TTTML workspace; docs/literate/tttml.org explains it). Run it with "xetal run demos/tttml.xtl", or as a notebook with "just tttml" (the optimized build: training takes seconds).

It shows a board and its outcome, the codes that make turned and reflected boards one position, then trains a model on 2000 games against itself and measures it against a random player and itself.

source · imports t: lib/TTTML.xtl

Training and measuring

m : Float

value · line 30

The model learned from 2000 games against itself.

m ← 2000 ᵗt̲rain! ᵗempty