Your program should work for a player being either a person or a computer. Near the beginning the program should prompt for the names of each player and, for each player, ask whether the player is a person or a computer.
Your program should then prompt the user for the number of sticks in each row to set up the Nim board. The player whose name was entered first will take the first turn. A human player will enter two integers for a turn - the first will be the number of the row they want to remove sticks from and the second will be the number of sticks to remove from that row. The program should make sure that the numbers input are valid. A computer player will generate a random play - that is a row number between 1 and 3 and then a random number of sticks to remove from that row (the play generated should be valid). After each player makes a move the board should be displayed in a format similar to the following:
Row 1: | | | Row 2: | | Row 3: | | | | | |The players continue taking turns until no sticks remain. The program should keep track of the number of moves made by each player and the total number of sticks removed by each player. At the end of a game it should print the name of the winner along with the number of moves and the number of sticks removed for each of the players.
After each game the program should ask if the user wants to play again. If so, ask again about the number of sticks in each row (but assume the players will be the same) to set up a new board. The program should keep track of overall statistics - how many times each player won, the average number of moves the winning player made, the minimum number of moves the winning player made, and the maximum number of moves the winning player made. These statistics should be printed at the end of the program.
Step #1: Design (due in class Friday, Nov. 11)
Hand in your skeleton and work plan in class on Friday. DO NOT BEGIN IMPLEMENTING
Step #2: Implement Phase I Specifications will be handed out in class Wednesday.
Step #3: Correct & Complete the Program!
Requirements: As always, your program should:
Grading As usual your program will be graded on both style and correctness with very little credit for a program that does not compile or run. A grading rubric will be handed out.
Academic Integrity Reminder: Programming assignments are to be your own work. You may get help on the specifics of the assignment from no one except the instructor. You may not show your program to anyone or look at anyone's program or share ideas with anyone about how to write the program.
Hand in: For phase I just send a tar file by email. For the completed project send a tar file and hand in printed copies of all program files.