Rock, Paper, Scissors : Frontend Coding Exercise

This is where you can share your code for solving the Rock, Paper, Scissors exercise :slight_smile:

It’s interesting how a simple game like Rock, Paper, Scissors can quickly expose the complexities of state. My students always get tripped up on managing scores and choices across rounds. The choices are straightforward, but keeping track of who picked what, and then updating scores reliably, often leads to some tangled logic.

// A simplified example of the state they often struggle with
let playerScore = 0;
let computerScore = 0;
let playerChoice = ''; // 'rock', 'paper', or 'scissors'
let computerChoice = '';