Question
Program must be written in python Question 1: ( 50 points) Write a Python program that lets the user play the game of Rock Plastic
Program must be written in python
Question 1: ( 50 points)
Write a Python program that lets the user play the game of Rock Plastic Dragon against the computer.
The program should work as follows:
-
The user enters his choice of rock, plastic or dragon at the keyboard.
-
If the user enters a wrong choice ask the user to enter again.
-
When the program begins a random number is generated as 10 20 or 30. If the number is 10, computer has chosen dragon, if the number is 20 computer has chosen rock and if 30 computer has chosen plastic.
-
The computers choice is displayed.
-
A winner is selected according to the following rules.
-
If one player chooses rock and other player chooses dragon then rock wins. (Rock smashes dragon.)
-
If one player chooses plastic and other player chooses dragon then dragon wins. (Dragon burns plastic)
-
If one player chooses rock and other player chooses plastic then plastic wins. (Plastic wraps rock)
-
If both players make the same choice the game must be played again to determine the winner.
-
-
The function should be named as RPDLastName (your lastname in place of lastname).
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