Question: 1 3 . 7 . 1 : Project - PartA: Rock, Paper, Scissors Round 2 - Player in coral language 1 3 . 7 Project

13.7.1: Project - PartA: Rock, Paper, Scissors Round 2-Player in coral language 13.7 Project - PartA: Rock, Paper, Scissors Round 2-Player (LT-C-SP24)
In this Assignment, you will write the first part of the Project: Rock, Paper, Scissors game.
This first part is called PartA. You will write one round of play between two players.
In a round of play, each of the 2 players selects one of the following without showing it to the other player: rock, paper, or scissors.
The program then determines who won and displays the results of the round.
Rules of Rock, Paper, Scissors
The rules of the Rock, Paper, Scissors Game are:
paper beats rock
scissors beats paper
rock beats 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 to encode the player choices:
0- rock
1- paper
2- scissors
You will write functions with the following signatures:
Function Main() returns nothing
Function Main() will read two values from input indicating the choices of player 1 nad player 2, and then call each of the other functions (below) to determine the winner and display the information on the round.
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. It will return 0 for a tie, 1 if player1 won the round, and 2 if player 2 won the round.
Function DisplayRound(integer player1_choice, integer player2_choice, integer winner) returns nothing
Function DisplayRound() will display the information on the round, per the output example below. Note: There is a blank line at the end of the block of llines of output.

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