OverviewTask: Write a bash script (rps.sh) that allows you to play "Rock, Paper, Scissors" against the computer.Purpose: Demonstrate the skill to write a bash shell script.InstructionsWrite a...

1 answer below »
see file


Overview Task: Write a bash script (rps.sh) that allows you to play "Rock, Paper, Scissors" against the computer. Purpose: Demonstrate the skill to write a bash shell script. Instructions Write a bash script (rps.sh) that allows you to play "Rock, Paper, Scissors" against the computer. The script should run as follows: Requirements Your bash script should present the following set of features (which are also in the attached rubric): 1. The game allows you to play Rock, Paper, Scissors against the computer. 2. The game is menu-driven. 3. The game runs continuously. 4. The game terminates when option 4 is selected. 5. The game plays according to the standard rule. 6. The game displays the same or similar messages as shown in the example output (shown above). Your bash script must include the following constructs and statements: 1. if 2. while 3. break 4. echo To allow the computer to play the game, use the following command: computer=$(( ( RANDOM % 3 ) + 1 )) if (( "$computer" == 1 )) then echo "Computer chose 1. Rock" elif .... .... Submission Details As you complete this assignment, look at the rubric below. Realize that this is an "all-or-nothing" assignment when it comes to grading criteria. Either your script can do the required actions or it cannot. 1. Upload your bash script (rps.sh) in Canvas. 2. Record your “Rock, Paper, Scissors” gameplay using the following command and upload the generated files (BashProj.log and BashProj.timing). Make sure that your recorded gameplay includes all four choices you can make (1. Rock, 2. Paper, 3. Scissors, 4. Done). Demonstrate that your bash script will correctly produce three outcomes that are possible (You won, You lost, You tied). Your demonstration of correct outcome need not be exhaustive. It can look like the one listed above. Just one instance of win, one instance of loss, and one instance of tie will do. [me@linuxbox ~]$ script -a BashProj.log --timing=BashProj.timing [me@linuxbox ~]$ . ./rps.sh after the game play [me@linuxbox ~]$ exit [me@linuxbox ~]$ ls BashProj.log BashProj.timing
Answered 1 days AfterMar 21, 2023

Answer To: OverviewTask: Write a bash script (rps.sh) that allows you to play "Rock, Paper, Scissors" against...

Ritish answered on Mar 23 2023
47 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here