Computing the Grundy sequences for octal games

Jason Catterton · Journal of computing sciences in colleges · 2005

Two player games, such as Nim and Kayles, in which players can remove a number of stones and leave a certain number of piles of stones afterwards, are octal if and only if you can leave at most two piles. The rules for an octal game may be encoded as a decimal, 0.d1d2d3...dn where di signifies how many piles you can leave after taking i stones. The digit di is formed as a sum of the powers of two with the exponent indicating a valid number of piles to leave. For example, if you can remove i stones and leave 0 or 1 piles then di will be 1(20) + 1(21) + 0(22). The encoding of the rules for Kayles is 0.77 because you can take one or two stones and leave 0, 1, or 2 piles after a move.

Read the paper · More papers on PaperTik