Game of Nim implemented in Python