Question: CORAL CODE ONLY! NO OTHER LANGUAGE! MAKE SURE CODE OUTPUTS LIKE EXAMPLE PHOTO PROVIDED!!! In this Project - FINAL code assignment, you will complete your
CORAL CODE ONLY! NO OTHER LANGUAGE! MAKE SURE CODE OUTPUTS LIKE EXAMPLE PHOTO PROVIDED!!! In this ProjectFINAL code assignment, you will complete your code for the game of Rock, Paper, Scissors. In this game, each of the players where the second player of whom may be the computer selects one of the following without showing it to the other player: rock, paper, or scissors.
In this FINAL part, you will add the last requirementcapability which is to play a Game with multiple rounds rather a single Round. The program will also keep track of display the total number of wins by each of the two players.
The Inputs
The first number in the input box is still the game choice of whether the second player is a computer, or a person is indicated by the first number read from the input box: both players are people using the input box
the second player is a computer using a random number The second number in the input box is the number of rounds of play in the game.
The remaining numbers in input box are the player choices for each round. There is either for one player for each round if the second player is the computer or the choices for each of the two players if the second player is also a person one round at a time.
The Rules of the Game:
The rules of the game are paper beats rock, scissors beat paper, rock beat scissors, and if both players select the same item say both select rock then it is a tie.
Since the Coral pseudocode language does not support characters or strings, we will use the following encoding: rock
paper
scissors Required Functions
You will write functions with the following signatures:
Function Main returns nothing
Function Main will read the first input which is the number of rounds to play. The function will use a loop to play that number of rounds of Rock, Paper, Scissors. Each round, each of the two player's choice of rock, paper, scissors will be read from input. The other functions below will be called to determine the winner and display the information on the round. Function Main will also keep track of how many times each of the two player's wins. After the loop ends, this information will be displayed. Function GetRoundWinnerinteger playerchoice, integer playerchoice returns integer winner
Function GetRoundWinner will determine which of the two players won the round, following the rules of the game. It will not display any information to output but will return the number of the winning player. The winner will be: if the first player won, if the second player won, or if it is a tie. Function DisplayRoundinteger roundnum, integer playerchoice, integer playerchoice, integer winner returns nothing
Function DisplayRound will display the information on the round, per the output example below. There is a change requirement to this Function in this Final part.
This function now has one more argument called roundnum, and this information is displayed as part of the output from this function.
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
