programlibs/Bits/demos/nim.xtl
Nim: heaps of counters; take any number from one heap; whoever takes the last counter wins. The winning move makes the xor of the heaps (the nim-sum) zero, worked out for every heap at once. Run with "just demo Bits nim".
nimsum : Int
nimsum ← (f̲irst heaps) ᵇx̲or (f̲irst 1 d̲rop heaps) ᵇx̲or f̲irst 2 d̲rop heaps
Used in: libs/Bits/demos/nim.xtl:10, target