It’s a Python Programming problem
Rock, paper, scissors, Spock, lizard 1. Your assignment is to program a two-player game of “Rock, Paper, Scissors, Spock, Lizard,” which uses hand motions but can be simulated on a computer by substituting the numbers 1-5. You will program two versions of the game. In the first version, the user is one player, and the computer is the second player. Begin by asking the user to input his/her choice of rock, etc. The computer will then choose its move randomly. If the two moves are the same, it is a tie, and the players must choose again. Otherwise the winner is based on the following rules: • scissors cuts paper • paper covers rock • rock crushes lizard • lizard poisons Spock . Spock smashes scissors • scissors decapitates lizard • lizard eats paper • paper disproves Spock • Spock vaporizes rock • rock crushes scissors The program should give feedback about who won, with a message about the relevant rule above. You should write a function that finds the winner for each round of the game. 2. Now set up a version of the game with the computer playing itself: choosing random moves for “Player 1” and for “Player 2”. Since there is no need for user input, 1000 games can be played very quickly. Present the outcome of these games by two different histogram plots. One is a histogram of the different moves chosen by Player 1. The other is a histogram of number of wins by each player, as well as the number of initial) ties. Use Jupyter Notebook for this assignment and submit it to Canvas. Show transcribed image text Rock, paper, scissors, Spock, lizard 1. Your assignment is to program a two-player game of “Rock, Paper, Scissors, Spock, Lizard,” which uses hand motions but can be simulated on a computer by substituting the numbers 1-5. You will program two versions of the game. In the first version, the user is one player, and the computer is the second player. Begin by asking the user to input his/her choice of rock, etc. The computer will then choose its move randomly. If the two moves are the same, it is a tie, and the players must choose again. Otherwise the winner is based on the following rules: • scissors cuts paper • paper covers rock • rock crushes lizard • lizard poisons Spock . Spock smashes scissors • scissors decapitates lizard • lizard eats paper • paper disproves Spock • Spock vaporizes rock • rock crushes scissors The program should give feedback about who won, with a message about the relevant rule above. You should write a function that finds the winner for each round of the game. 2. Now set up a version of the game with the computer playing itself: choosing random moves for “Player 1” and for “Player 2”. Since there is no need for user input, 1000 games can be played very quickly. Present the outcome of these games by two different histogram plots. One is a histogram of the different moves chosen by Player 1. The other is a histogram of number of wins by each player, as well as the number of initial) ties. Use Jupyter Notebook for this assignment and submit it to Canvas.
Expert Answer
Answer to Rock, paper, scissors, Spock, lizard 1. Your assignment is to program a two-player game of “Rock, Paper, Scissors, Spock…