...

Exercise: Rock Paper Scissors

Let's build the classic game of Rock Paper Scissors! Here are the basic rules:

  • Rock beats scissors
  • Scissors beats paper
  • Paper beats rock
  • Same choices result in a tie

Your Task

Complete all the else if conditions using the && operator. Each condition needs to check both player1 AND player2 choices.

Think Through the Logic

There are 9 total combinations possible. You need to account for:

  • 3 ways Player 1 wins (including the one already given)
  • 3 ways Player 2 wins
  • 3 ways to tie

Complete the code and run it to see the results.

Loading...

Output (Console)