Source: https://jeuxmath.ch/DiversE/Nim.pdf