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, 22.06.2019 21:00
So im doing this school challenge and the teachers said whats the average text a student gets a day so i need to get about 20 in a day but dont know how can you guys 2163371293
Answers: 2
question
Computers and Technology, 23.06.2019 01:00
Let r be a robotic arm with a fixed base and seven links. the last joint of r is a prismatic joint, the other ones are revolute joints. give a set of parameters that determines a placement of r. what is the dimension of the configuration space resulting from your choice of parameters?
Answers: 3
question
Computers and Technology, 23.06.2019 21:40
Simon says is a memory game where "simon" outputs a sequence of 10 characters (r, g, b, y) and the user must repeat the sequence. create a for loop that compares the two strings. for each match, add one point to user_score. upon a mismatch, end the game. sample output with inputs: 'rrgbryybgy' 'rrgbbrybgy'
Answers: 3
question
Computers and Technology, 25.06.2019 04:10
8. create an abstract student class for parker university. the class contains fields for student id number, last name, and annual tuition. include a constructor that requires parameters for the id number and name. include get and set methods for each field; the settuition() method is abstract. create three student subclasses named undergraduatestudent, graduatestudent, and studentatlarge, each with a unique settuition() method. tuition for an undergraduatestudent is $4,000 per semester, tuition for a graduatestudent is $6,000 per semester, and tuition for a studentatlarge is $2,000 per semester. write an application that creates an array of at least six objects to demonstrate how the methods work for objects for each student type. save the files as student.java, undergraduatestudent.java, graduatestudent.java, studentatlarge.java, and studentdemo.java.
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, 06.10.2021 14:00
question
Computers and Technology, 06.10.2021 14:00
Questions on the website: 13722360