Nim game solver in Prolog.