Computers and Technology, 29.10.2021 04:00 lcdavis16
Add the following features to your RPS program:
Handle scenario if enters an integer other than 1, 2, or 3. Print "invalid" message and loop again.
Handle the exeption if user enters "abc" or a float. Print "invalid" message and loop again
Keep a counter of how many times the human has won, and how many times comp has won.
After each round, print the outcome and print the counters.
Keep playing until the human or the computer wins twice.
Change your logic to determine the outcome:
Add a 2D list at the top of your code that stores all outcome combinations
Replace your if statement – lookup the outcome from the 2D list
Print a "goodbye" message at the end of the program.
Requirements – Planned Output:
Enter 1 for Rock, 2 for Paper, 3 for Scissors: abc
Please only enter an integer. Try again.
Enter 1 for Rock, 2 for Paper, 3 for Scissors: 60
Invalid int. Please enter 1, 2, or 3. Try again.
Enter 1 for Rock, 2 for Paper, 3 for Scissors: 2
You chose paper
The computer chose scissors
You lost.
Human: 0 Computer: 1
Enter 1 for Rock, 2 for Paper, 3 for Scissors: 3
You chose scissors
The computer chose paper
Congrats, you won!
Human: 1 Computer: 1
Enter 1 for Rock, 2 for Paper, 3 for Scissors: 1
You chose rock
The computer chose scissors
Congrats, you won!
Human: 2 Computer: 1
Answers: 2
Computers and Technology, 22.06.2019 21:10
Dameas communication challenge is due to which factor
Answers: 2
Computers and Technology, 23.06.2019 15:00
In the blank libreoffice writer document, to start the process of entering a date field into a letter, click on the insert menu. edit menu. file menu. fields menu.
Answers: 3
Computers and Technology, 24.06.2019 02:40
Has anyone seen my grandma shes been gone for 4 years already
Answers: 1
Computers and Technology, 24.06.2019 07:40
What type of multimedia are live news feeds? live news feeds are examples of multimedia.
Answers: 2
Add the following features to your RPS program:
Handle scenario if enters an integer other than 1,...
Chemistry, 03.02.2020 13:48
Mathematics, 03.02.2020 13:48
Mathematics, 03.02.2020 13:48
Mathematics, 03.02.2020 13:48
Social Studies, 03.02.2020 13:48
Mathematics, 03.02.2020 13:48
Mathematics, 03.02.2020 13:48
Mathematics, 03.02.2020 13:48
History, 03.02.2020 13:48
Mathematics, 03.02.2020 13:48
Mathematics, 03.02.2020 13:48
Biology, 03.02.2020 13:48
Chemistry, 03.02.2020 13:48