Question: Attached is the psuedocode for the rock paper scissors game. For this work, you will write code in Coral for your selected programming game. Specifically,

Attached is the psuedocode for the rock paper scissors game.
For this work, you will write code in Coral for your selected programming game.
Specifically, you must address the following rubric criteria:
Determine the variables and relevant data types of each variable. Consider the necessary variables required to implement the logic of your game, as well as the relevant data type (e.g., integer or float) of each variable. Consider your inputs and outputs for the program as you work.
Initialize the variables using appropriate data values. Where necessary, assign an initial value to each variable. Note that variables that obtain an initial value from user input do not require initializing. For example, before you start simulating any of the games, there should be zero wins and losses.
Set a branch that uses conditionals to define the logic of the game. This must meet the requirements of the program. This includes using the following:
IFIF-ELSEIF-ELSE-IF
Statements must also use the appropriate relational operators, which are as follows:
==(equals)!=(not equal)(less than)>(greater than)=(less than or equal)>=(greater than or equal)
Create one loop to define the logic, flow, and sequence of the game. This must meet the requirements of the program. Use a WHILE or FOR loop and the appropriate relational operators (==,!=,,>,=, and >=). Avoid infinite loops by ensuring the loop has an exit condition using the appropriate relational operator.
Rock-Paper-Scissors: Write code that will play the game once.
Apply necessary arithmetic operations. Note that mathematical operators include +,-,*,/, and %(modulo). This must meet the requirements of the program. For example, in each of the games, you will want to keep track of wins and losses.
Rock-Paper-Scissors: Keep track of the player who won the first round in the Rock-Paper-Scissors game.
Write code using best practices including appropriate syntax and commenting. This includes the following:
Using descriptive names for your variables. Using the correct formatting structure with appropriate indentations. Using appropriate comments relating to your code 1. Start
2.
3. Set up the variables:
4.
5. userWins \(=0\)
6.
7. computerWins \(=0\)
8.
9. Ties \(=0\)
10.
11. Round \(=1\)
12.
13. Loop round \(=10\) :
14.
15. "Round [round]" is displayed. Select Scissors (3), Rock (1), or Paper (2).
16.
17. Get user input: userChoice
18.
19. Create a computer selection at random from 1 to 3: computerChoice
20.
21. Comparison between userChoice and computerChoice determines the decision.
22.
23. If userChoice \(==\) computerChoice:
24.
25. Increment ties by 1
26.
27. Show "It's a tie!"
28.
29. Else if userChoice \(==1\)(Rock) and computerChoice \(==3\)(Scissors),
30. Or userChoice \(=2\)(Paper) and computerChoice \(==1\)(Rock)
31. Or userChoice \(==3\)(Scissors) and computerChoice \(=2\)(Paper):
32.
33. Boost user wins by 1.
34.
35. Show: "You win this round!"
36.
37. Else:
38.
39. Computer boost wins by 1.
40.
41. "Computer wins this round!" is displayed.
42.
43. Increment round by 1
44.
45. End loop
46.
Attached is the psuedocode for the rock paper

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!