Skip to main content

Rock Paper Scissors

Play rock-paper-scissors against a random or pattern-detecting CPU with a running W/L/D score.

Written by Golam Rabbani, Founder & Lead Engineer

CPU strategy
Wins: 0Losses: 0Draws: 0Rounds: 0

Tip: press R, P, or S on a keyboard.

Pick rock, paper, or scissors.

How to use this rock paper scissors

  1. Pick a CPU strategy: Random plays uniformly, Pattern detector counters your most-frequent recent move.
  2. Click Rock, Paper, or Scissors — or press R, P, or S on the keyboard — to throw a move.
  3. The result row shows what you and the CPU played and who won the round.
  4. Watch the running Wins / Losses / Draws counter update after every throw.
  5. Press Reset to clear the score and CPU memory, or Copy Score to copy the W-L-D line to your clipboard.

About this rock paper scissors

Rock-Paper-Scissors is the classic three-move game: rock crushes scissors, scissors cuts paper, paper covers rock. This tool plays you against one of two CPUs. Random simply samples uniformly from the three moves using window.crypto.getRandomValues for stronger randomness than Math.random; over many rounds your expected win rate is one third, with another third drawn and a third lost. The Pattern detector tracks your last ten throws, picks whichever move you played most often, then plays the move that counters it — so if you spammed rock, it will start throwing paper.

The score persists in memory only and is reset whenever you press Reset or refresh the page. Keyboard shortcuts (R, P, S) make rapid play possible without moving the mouse, which is useful when testing whether the pattern detector noticed your bias.

Worked example: switch the CPU to Pattern detector and throw three rocks in a row. Your move history now reads [rock, rock, rock]. The detector sees rock as your most-frequent recent move (3 of 3) and counters with paper on the fourth throw. If you then throw scissors, you beat the paper and your score becomes 1 W · 3 L · 0 D — the detector is reactive, so as soon as your history shifts to mostly scissors it will start playing rock instead. Switching back to Random removes the memory effect.

FAQ

How "random" is the Random CPU?
It uses window.crypto.getRandomValues to seed each pick, which is cryptographically strong RNG in the browser. The CPU has no memory between throws in Random mode.
How does the Pattern detector work?
It looks at your last ten moves, finds your most-frequent move, and plays whichever move beats that. After three or fewer throws it falls back to random because there is not enough history to detect a pattern.
Can I beat the Pattern detector?
Yes — once you notice it counters your favourite move, vary your throws or deliberately play the move that beats its expected counter. Truly random play averages out to one third wins.
Does the keyboard work?
Yes. Press R, P, or S to play rock, paper, or scissors. Enter from anywhere in the form throws rock by default for convenience.
Are scores saved between sessions?
No — closing the page or pressing Reset clears everything. The tool stores no data on a server.
Why are draws possible?
Both players can pick the same move on a given throw. Standard RPS rules treat matching moves as a draw and no point is awarded.