SparkJS Logo
HomeBeginnerRock Paper Scissors

✊✋✌️ Rock Paper Scissors

Classic game of strategy! Can you beat the computer?

⏱️ 1 hour⚡ Beginner🎮 Game Project

Choose Your Weapon:

🎯 How to Play

  • 1.Choose Rock, Paper, or Scissors
  • 2.Watch the computer make its choice
  • 3.🪨 Rock beats Scissors, ✂️ Scissors beats Paper, 📄 Paper beats Rock
  • 4.Try to win as many rounds as possible!

🏆 Score Board

Your Wins:0
Computer Wins:0
Ties:0

📊 Statistics

Total Rounds:0
Win Rate:0.0%

📜 Game History(Last 10)

No games yet. Start playing!

💡 What You'll Learn

🎲 Random Selection

Generate random computer choices from an array of options.

// Random choice
let choices = ['rock', 
  'paper', 'scissors'];
let pick = choices[
  Math.floor(
    Math.random() * 3
  )
];

🔀 Game Logic

Implement complex conditional logic to determine winners.

if (player === computer) 
  return 'tie';
if (player === 'rock' && 
    computer === 'scissors')
  return 'win';

⏱️ Animations

Create reveal animations using intervals for suspense.

let interval = 
  setInterval(() => {
  showRandomChoice();
  if (count >= 8) 
    clearInterval(interval);
}, 100);

📊 Score Tracking

Track scores, history, and calculate win rates.

let score = {
  player: 0,
  computer: 0,
  ties: 0
};
score.player++;

🚀 Challenge: Enhance This Game!

Try adding these features to level up your skills:

🎵 Sound Effects

Add winning/losing sounds for each round!

🏆 Best of 5 Mode

First to 3 wins takes the match!

🦎 Add Lizard & Spock

Expand to 5-choice RPSLS variant!

🤖 Smart AI

AI that learns from your patterns!