This is a web-based Rock Paper Scissors game where the player competes against the computer. The app runs directly in the browser and uses JavaScript to generate the computer’s move and determine the winner. The score is stored using localStorage, so it persists even if you refresh the page.
- Three selectable moves: Rock, Paper, and Scissors
- Random computer move generation
- Round result display
- Scoreboard saved in browser storage
- Reset score button
- Simple and clean UI
- HTML5: Structure of the game interface
- CSS3: Styling
- JavaScript: Game logic and DOM manipulation
- LocalStorage: For saving game progress
/
├── index.html # Main game UI
├── css/
│ └── styles.css # Styling
├── scripts/
│ └── scripts.js # Game logic
└── img/ # Rock, paper, scissors emojis
- The user clicks a move button.
- The JavaScript function
playGame()compares:- The player's move
- The computer's randomly generated move
- The result elements update:
- Result message
- Moves display
- Scoreboard (wins, losses, ties)
The score uses localStorage to persist after refresh.
Experience the game live: Rock, Paper, Scissors Game
- Open the game in your web browser.
- Click on your choice of Rock, Paper, or Scissors.
- View the computer's choice and the result.
- Play again!
To run this project locally:
- Clone the repository:
git clone https://github.com/sovilleda07/rock-paper-scissors.git- Navigate to the project directory:
cd rock-paper-scissors-game- Open
index.htmlin your preferred web browser
This project is free for personal or educational use.