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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 04:31, Remba
Q14 what is most important for you to choose before you build a network? a. private network b. nos c. network media d. network protocol e. directory service
Answers: 1
image
Computers and Technology, 23.06.2019 09:50, tatumleigh04
Allison and her group have completed the data entry for their spreadsheet project. they are in the process of formatting the data to make it easier to read and understand. the title is located in cell a5. the group has decided to merge cells a3: a7 to attempt to center the title over the data. after the merge, allison points out that it is not centered and looks bad. where would the title appear if allison unmerged the cells in an attempt to fix the title problem?
Answers: 2
image
Computers and Technology, 23.06.2019 11:30, kyraj21
Which excel file extension stores automated steps for repetitive tasks?
Answers: 1
image
Computers and Technology, 23.06.2019 22:30, reaganphelps3
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
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 in other subjects:

Konu
Social Studies, 02.02.2022 16:10