Describe an algorithm to play the game of nim


Describe an algorithm to play the Game of Nim using all of the three tools discussed in class (pseudocode, flowchart, hierarchy chart). The rules for the game are as follows:

  • - Two players take turns removing sticks from a pile of sticks.
  • - At the start of the game, there are 21 sticks on the pile.
  • - At each turn, a player can remove one, two, or three sticks from the pile.
  • - The game is over when the last stick is removed from the pile.
  • - The player who removes the last stick loses the game.

Include all necessary input, output, repetitions, sequences and decisions in your charts as appropriate.

Attachment:- Flowchart-Game-of-Nim.doc

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Describe an algorithm to play the game of nim
Reference No:- TGS014437

Now Priced at $40 (50% Discount)

Recommended (95%)

Rated (4.7/5)