subject

Rock, Paper, Scissors is a two-player game in which each player chooses one of three items. If both players choose the same item, the game is tied. Otherwise, the rules that determine the winner are:

(a) Rock always beats Scissors (Rock crushes Scissors)

(b) Scissors always beats Paper (Scissors cut Paper)

(c) Paper always beats Rock (Paper covers Rock) Implement function rps() that takes the choice ('R', 'P', or 'S') of player 1 and the choice of player 2, and returns βˆ’1 if player 1 wins, 1 if player 2 wins, or 0 if there is a tie.

>>> rps('R', 'P') 1

>>> rps('R', 'S') -1

>>> rps('S', 'S') 0

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 22:30
What would be the address of the cell, which is at the intersection of the second row and the third column in a worksheet?
Answers: 1
question
Computers and Technology, 24.06.2019 13:30
To move an excel worksheet tab, simply right-click on it drag and drop it double-click on it delete it
Answers: 1
question
Computers and Technology, 24.06.2019 17:30
Click on the tab on the ribbon to open the backstage view. file view insert review
Answers: 1
question
Computers and Technology, 25.06.2019 08:30
Acollection of computers and other devices that are connected together to enable users to share hardware, software, and data, as well as to communicate electronically with each other is called
Answers: 1
You know the right answer?
Rock, Paper, Scissors is a two-player game in which each player chooses one of three items. If both...
Questions
question
Mathematics, 23.07.2019 22:00
question
Mathematics, 23.07.2019 22:00
Questions on the website: 13722367