Question: Write a c + + program as basic / simple as possible. Code conditions: The game displays two options: 1 - Two players ( user
Write a c program as basicsimple as possible. Code conditions:
The game displays two options:
Two players user vs user
Two players PC vs user
In the next step, the users must enter their names. Thus, the player's turn is displayed during the game run.
At the end of the game, display the name of the winner.
The first, user vs user, option allows two people to play the game.
Prompt the user to enter the total number of tokens must be otherwise prompt the user to try
again
Distribute tokens to piles randomly so that there is no empty pile at the beginning.
For example, let's say the user enters tokens, the game might display the following:
A:
B:
C:
D:
E: O
Note her the pile is represented by a row but you can draw it vertically as you like.
Assume player selects two tokens from the second pile, shehe may enter B or B then the game
shows
A:
B:
C:
D: OOOO
E: O
The second option, PC vs user, option allows the user to play against your algorithm.
Instead of using only heaps, prompt the user to enter the number of heaps or columns
The number of heaps piles can range from to
Distribute tokens to all piles based on the following function:
For example, the first pile has two tokens, the second pile has four tokens,
and so on
Develop an algorithm enabling your game to play and win against any user.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
