Hacker Challenge: Rock, Paper, and Scissors Tournament
Let's create a Rock, Paper, Scissors game.
In this lesson, we will create a game of “Rock, Paper, Scissors”.
After implementing the simple logic of the game, we will primarily ensure that:
- The choices of the players are not visible to each other.
- The game becomes a tournament (so the players can play the game multiple times).
So, let’s get to it!
Rules of the game
There will be 2 players, and each player will choose either of the 3 symbols listed below:
- ‘s’ represents scissors.
- ‘p’ represents paper.
- ‘r’ represents rock.
The rules are as follows:
- The scissors can cut the paper.
- The rock can break the scissors.
- The paper can cover the rock.
Write a program that implements the logic of the “Rock, Paper, Scissors” game. In this game, two players individually select “rock,” “paper,” or “scissors" by typing r
for rock, p
for paper, or s
for scissors. The winner is the one whose choice dominates the other.
Get hands-on with 1200+ tech skills courses.