Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Scripts Script 1 : Rock, Paper, Scissors Create a script that allows the script user to play Rock, Paper, Scissors against the CPU. The script
Scripts
Script : Rock, Paper, Scissors
Create a script that allows the script user to play Rock, Paper, Scissors against the CPU.
The script must meet the following requirements:
Use a menu to display the script user's choices:
Rock
Paper
Scissors
Quit
Use a select statement as the method to create the menu and take the script user's
choice.
Conditional statements to handle the possible outcomes of the game ie tell the user
who wins in each scenario
Use a case statement to handle processing of what happens once the script user's
selection has been made.
Helpful Hints
You can use the shuf command to simulate the script's turn at the game. Research the syntax of
the command and how you can use it for this script's purpose.
For example:
cpuSelection$shuf n e
The command above will simply shuffle the items into a different order. The option tells the
command to output only the number provided with the option. In this case, a indicates that
we only want the first shuffled item to be sent to output. This simulates a random choice.
You are free to use the command exactly like it is for your script, but you just need to find a way
in your script to convert the numbers to the necessary option Rock Paper, Scissors
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started