Question: Project Instructions Type: This game ( project is a team of 2 students ) . A group is compulsory. To create this game you are

Project Instructions
Type: This game (project is a team of 2 students). A group is compulsory.
To create this game you are allowed to use materials and concepts covered during COEN 243
lectures.
It is not allowed to use something that we didn't cover during our study otherwise, 20% of your
grade will be deducted.
Submission:
Create one or more .cpp files (possibly a .h file) as you need.
Create a PDF file containing the screenshots of all use cases and their results.
Save the PDF, the .cpp files, the project form, and any additional files in one folder.
Name the folder as your lastname_student id
Compress the files using zip or other tools
Submit the zip file on Moodle
Please do not submit exe files
Only one student from a team can submit a project solution. Therefore, there is no need
for all team members to submit the same copy.
The main objective of this game is to apply the knowledge gained from the course lectures.
Project question
Write the code in C++ to simulate a Nim game. The rules of Nim are as follows:
1- This game includes two players.
2- Each player can pick up from one pile.
3- The player can only take one or two tokens.
4- The winner is the player who makes the last move.
5- Suppose we only have 5 heaps.
8- The game must be recursive, namely, it calls itself each turn.
7- Try to use an array in C++ style (for example to represent the heaps).Note her the pile is represented by a row but you can draw it vertically as you like.
Assume player 1 selects two tokens from the second pile, she/he may enter B2 or B 2 then the game
shows
A: 00
B: 00
C: 000
D: OOOOO
E: O
The second option, PC vs user, option allows the user to play against your algorithm.
Instead of using only 5 heaps, prompt the user to enter the number of heaps (or c olumns).
The number of heaps (piles) can range from 2 to 10.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!