Bite 160. 15-way Rock Paper Scissors

In this Bite you are going to write a 15-way Rock Paper Scissors game (this challenge first appeared as part of our 100 Days of Code in Python course).

picture of who beats who in this 15-way version of rock paper scissors


The way you read this graphic is if an arrow points from one item to another, that pointed-to item is defeated. For example:

  • Paper defeats rock (paper points to rock)
  • Devil defeats human (devil points to human)

It turns out to be error prone and generally very unfun to work this out from the graphic. So we created a csv score sheet representing these relationships.

Complete the get_winner function following the docstring. We recommend parsing it into a dictionary/mapping of players -> beats whom (key, value) pairs (helper function _create_defeat_mapping). This will make it easier to determine the winner given any pair of (player1, player2) pairs.

The tests (see TESTS tab) will verify valid input to get_winner, all Tie scenarios and (more interestingly) all 105 outcomes using the original RPS-15 speak.

Good luck and have fun!

7 out of 8 users completed this Bite.
Will you be Pythonista #8 to crack this Bite?
Average Bite difficulty 1-10 rating: 3.0
» You can do it! 😌

Github login button
We use Python 3.7