Skip to content
jsworkbench.
All projects
Intermediate40 min

Rock, paper, scissors

Build on the real game: moves, a persistent score, and automatic play.

ConditionalsLocal storageTimers

YOUR BUILD CHECKLIST

  1. Follow playGame and pickComputerMove.
  2. Play all three moves and verify score changes.
  3. Try keyboard shortcuts and start/stop auto play.
Editable original
Opening editor…
LIVE PREVIEW
Console 0

Your console output appears here.

Saved on this deviceJavaScript · ES2022
Notes on this source port
  • Fix the paper-versus-rock win string so wins count; replace invalid nested buttons with textContent; update scores after keyboard moves.

Make it your own

The original works. These are your next experiments.

  • Extract the winner rules into a lookup table.
  • Add a bounded match history.
Open a fresh playground