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 Project-FINAL code assignment, you will complete your code for the game of Rock, Paper, Scissors. In this game, each of the 2 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 requirement/capability 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: 0- both players are people (using the input box)
1- 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: 0- rock
1- paper
2- 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 GetRoundWinner(integer player1_choice, integer player2_choice) 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: 1 if the first player won, 2 if the second player won, or 0 if it is a tie. Function DisplayRound(integer round_num, integer player1_choice, integer player2_choice, 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 round_num, and this information is displayed as part of the output from this function.
CORAL CODE ONLY! NO OTHER LANGUAGE! MAKE SURE

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 Finance Questions!