Question: Objective: To play the rock-paper-scissors game. This program should play the rock-paper-scissors game, which is where the player picks either rock, paper, or scissors, the
Objective: To play the rock-paper-scissors game This program should play the rock-paper-scissors game, which is where the player picks either rock, paper, or scissors, the computer does the same, and then one of the following happen . Rock breaks scissors Paper covers rock . Scissors cut paper * There is a tie (both players picked the same thing) If the user enters invalid input, your program should say so, otherwise it will output one of the above results. You should randomly generate a number to determine the computers move. Here is some sample output: [cpers iko@ fog cs 110a]$ python 3 rps.py.txt Please enter your move Paper, Rock, or Scissors: Paper Computer's move is Paper Tie with Paper epersikolfog cs110a1$ python3 rps.py.txt Please enter your move: Paper, Rock, or Scissorsi paper Computer's move is Scissors Computer Winsl Scissors cut Paper!! [cpersiko@fog cs 110a)s python 3 rps.py.txt Please enter your move: Paper, Rock, or Scissors: scissors Computer's move is Scissors Tie with Seissors! cpersikolfog cs110a1s python3 rps.py.txt Please enter your move: Paper, Rock, or Scissors: Selssor Computer's move is Paper You Winl Scissors Cut Paper!! [cpersikotfog cs110a]$ python3 rps.py.txt Please enter your move: Paper, Rock, or Scissors: rock Computer's move is Paper Computer Winst Paper Covers Rock! cpersikoefog ca110a1s python3 rps.py.txt Please enter your move: Paper, Rock, or Scissors: r Computer's move is Scissors Invalid move!l cpersikolfog cs110a] Here are the rules: Your program should accept input of upper-case and/or lower-case letters. You can use the string's lower function to convert it to lower case, for example: if user move. lower() .. , rock' Your program should accept "scissor" or "scissors" (with or without the s, upper or lower case) as meaning the same thing. Your program should have at least 2 functions, including a main) function (no global variables or global code other than a call to main within an if-statement) You should use at least one multi-way if-statement (using "elif"). * You should use at least one logical "and" or "or" in your program e You should always output who won (unless there's a tie). * The output should show a variety of test cases such as above. Every function (except main) needs to have a comment in a triple-quoted string at the beginning, briefly explaining what it does. Objective: To play the rock-paper-scissors game This program should play the rock-paper-scissors game, which is where the player picks either rock, paper, or scissors, the computer does the same, and then one of the following happen . Rock breaks scissors Paper covers rock . Scissors cut paper * There is a tie (both players picked the same thing) If the user enters invalid input, your program should say so, otherwise it will output one of the above results. You should randomly generate a number to determine the computers move. Here is some sample output: [cpers iko@ fog cs 110a]$ python 3 rps.py.txt Please enter your move Paper, Rock, or Scissors: Paper Computer's move is Paper Tie with Paper epersikolfog cs110a1$ python3 rps.py.txt Please enter your move: Paper, Rock, or Scissorsi paper Computer's move is Scissors Computer Winsl Scissors cut Paper!! [cpersiko@fog cs 110a)s python 3 rps.py.txt Please enter your move: Paper, Rock, or Scissors: scissors Computer's move is Scissors Tie with Seissors! cpersikolfog cs110a1s python3 rps.py.txt Please enter your move: Paper, Rock, or Scissors: Selssor Computer's move is Paper You Winl Scissors Cut Paper!! [cpersikotfog cs110a]$ python3 rps.py.txt Please enter your move: Paper, Rock, or Scissors: rock Computer's move is Paper Computer Winst Paper Covers Rock! cpersikoefog ca110a1s python3 rps.py.txt Please enter your move: Paper, Rock, or Scissors: r Computer's move is Scissors Invalid move!l cpersikolfog cs110a] Here are the rules: Your program should accept input of upper-case and/or lower-case letters. You can use the string's lower function to convert it to lower case, for example: if user move. lower() .. , rock' Your program should accept "scissor" or "scissors" (with or without the s, upper or lower case) as meaning the same thing. Your program should have at least 2 functions, including a main) function (no global variables or global code other than a call to main within an if-statement) You should use at least one multi-way if-statement (using "elif"). * You should use at least one logical "and" or "or" in your program e You should always output who won (unless there's a tie). * The output should show a variety of test cases such as above. Every function (except main) needs to have a comment in a triple-quoted string at the beginning, briefly explaining what it does
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
