In this game, the player and the computer take turns removing balls from a set of stacks. On each turn, a stack is selected and at least one ball must be removed from the stack. Any number of balls from this stack may be removed on one a turn. Depending on the settings being used, the goal of the game is either to avoid taking the last ball or to take the last ball. The player selects balls to remove, by clicking on a ball. When a ball is clicked, this ball and all balls above it are selected for removal. Once the player is happy with the selection, clicking the Remove Balls button will execute the removal and complete the players turn. The initial set up of the game can be viewed/changed by clicking on the Settings button. 1) The green buttons select the number of stacks. 2) Repeatedly clicking the yellow balls will change the starting stack size for each of the stacks. 3) The first orange button toggles between using the yellow balls and using a random set of starting heights. 4) The second orange button toggles between the player going first and the computer going first. 5) The third orange button toggles between versions of the game where taking the last ball results in losing or winning. Start a new game by clicking the New Game button.
See wikipedia https://en.wikipedia.org/wiki/Nim for a nice description of the game of Nim, including rules, strategy, and many variants of the game.