Understanding the Problem
Rock Paper Scissors is a game played between 2 players, and for the purpose of this project, a user and the computer. For a single game round, each player simultaneously selects one of Rock, Paper, or Scissors. A winner is determined according to the following rules:
- A selection of Paper beats Rock
- A selection of Rock beats Scissors
- A selection of Scissors beats Paper
- else if both players make the same choice, the game is tied.
Pseudocode
1. Computer randomly plays “Rock”, “Paper” or “Scissors”
2. User inputs “Rock”, “Paper” or “Scissors”
3. Compare both player selections and assign a winner
4. If Rock and Paper are played, Paper wins
5. If Rock and Scissors are played, Rock wins
6. If Paper and Scissors are played, Scissors wins
7. If both selections are the same, game is a tie
8. Ensure Player’s selection-input is case insensitive
9. Ensure Player’s selection-input is case insensitive
10. Play 5 game rounds and determine final winner
Concepts That Helped
- Array & String manipulation
- Functions
- Familiarity with conditional statements and comparisons
- String manipulation to ensure case-sensitivity validation using toLowerCase()
- Loops to keep count of multiple rounds and stop at 5 rounds
- Googling, Grit and Github
Challenges & Learning Moments
- Had no trouble creating the functions but struggled somewhat with looping them and displaying the score. Referenced previous attempts and discussions in the Odin Project server
- Learned Array & String manipulation as well as array.length property
Top comments (0)