Computers and Technology
Computers and Technology, 24.01.2020 23:31, AshNo

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

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:00, 2alshawe201
The three logical operators used to write compound conditions are "and," "or," and "not." a: true b: false
Answers: 2
image
Computers and Technology, 22.06.2019 19:20, manny2085
Amedian in the road will be marked with a white sign that has a black arrow going to the left of the median. true false
Answers: 1
image
Computers and Technology, 23.06.2019 10:00, uwunuzzles
How do i delete my account on this because i didn't read this agreements and also i put age at xd
Answers: 1
image
Computers and Technology, 23.06.2019 14:30, rose6038
Select the correct answer. peter has launched a website that features baby products. however, clients often find they are unable to access the website because the server is down. which feature of cybersecurity should peter focus on for his website? a. data authenticity b. data privacy c. data availability d. data integrity e. data encryption
Answers: 3
Do you know the correct 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
Computers and Technology, 14.05.2021 23:00