The Game of NIM

GitHub Repo

Python Download (v1.0)

One difficulty my partner and I had was an issue pertaining to the usage of recursion loops. Our dependence on recursion loops was not the smartest decision, and in turn, we had to change a few destructive recursive loops to while loops to make it less prone to crashing. Another difficulty we ran into had to do with the usage of unnecessary function to call for another function with no other intended purpose. The solution was to run through the program to clean up the code itself.

When the game starts, the user is greeted with the main menu, followed with information on how to start the game. The input “start” types to run the main portion of the game, asking for the names of both the players for future reference. The game’s instructions are explained at the beginning of the game when the game is started. The current player’s turn is initialized, and the player has the choice to either input “move” or “status”. Move allow the player to choose which pile and number of stones to choose. Status gives the player the option to see the current amount of stones in each pile.

NIM NIM Back