Three-Pile Nim

To upgrade to three-pile Nim, we need to change our game state ADT to:

where n = number of coins in first pile,
m = number of coins in second pile
k = number of coins in third pile

The Racket pair ADT can pair up any items, including other pairs:

          
To do this in Racket:
          (cons 6 (cons 4 5))