Welcome to my implementation of the classic "Rock Paper Scissors" game! I built this project as part of The Odin Project's Foundations curriculum to practice my JavaScript fundamentals.
Click here to play the game! (Note: You must open your browser console to see the game output.)
Since this is a logic-focused assignment, the game runs entirely in the Developer Console, not on the graphical web page.
- Open the Live Demo (or open
index.htmllocally). - Right-click anywhere on the page and select Inspect.
- Go to the Console tab.
- The game will prompt you to enter your choice (Rock, Paper, or Scissors).
- Play 5 rounds to see who wins the final score!
- 5-Round Game Loop: The game automatically runs for 5 rounds.
- Score Tracking: Keeps track of the Player vs. Computer score.
- Input Validation: Handles capitalization automatically (e.g., "rock", "Rock", and "ROCK" are all accepted).
- Random Computer Choice: The computer selects its move randomly using
Math.random().
- JavaScript (ES6): Used for all game logic, DOM interaction, and loops.
- HTML5: Basic structure to host the script.
This project helped me solidify my understanding of:
- Writing functions and return values.
- Using
Math.random()to generate computer choices. - Using
prompt()for user input. - Implementing
if/elselogic and comparison operators. - Debugging with the Chrome Developer Tools.
A huge thank you to The Odin Project for their amazing curriculum. This assignment was a great way to bridge the gap between simple variables and actual game logic.
Created by Anura Rohana