Dartlang learning exercise using NIM game theory