Rock, paper, scissors

Face off against the computer — who beats who?

Builder· ages 10–1220 mindictsrandomconditionals
rps.py

First load pulls ~10 MB of Python. Only happens once — the browser caches it after.

What should the output look like?

The output should show your move, the computer's move, and who won or if it was a tie.

📖

How this works

A dict is like a mini phonebook: each key points to a value. Here it stores the game rules. Look up what your move beats, and compare to the computer's move to decide the winner.

Your turn — try these

  • 1Add Lizard and Spock (Rock-Paper-Scissors-Lizard-Spock).
  • 2Loop it: play 20 rounds automatically and keep a running score.
  • 3Weight the computer's choices — make it pick scissors 50% of the time.