https://github.com/netbr3ak/rock-paper-scissors
đǍđâī¸ Enjoy the classic Rock Paper Scissors game against the computer! Built with HTML and JavaScript, this project lets you play 5 rounds and see who emerges victorious. Have fun challenging yourself in this timeless game!
https://github.com/netbr3ak/rock-paper-scissors
github-pages html5 interactive-game javascript strategy-game
Last synced: 11 months ago
JSON representation
đǍđâī¸ Enjoy the classic Rock Paper Scissors game against the computer! Built with HTML and JavaScript, this project lets you play 5 rounds and see who emerges victorious. Have fun challenging yourself in this timeless game!
- Host: GitHub
- URL: https://github.com/netbr3ak/rock-paper-scissors
- Owner: NetBr3ak
- License: mit
- Created: 2024-05-31T16:30:09.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-23T02:38:44.000Z (over 1 year ago)
- Last Synced: 2025-02-24T01:51:17.717Z (over 1 year ago)
- Topics: github-pages, html5, interactive-game, javascript, strategy-game
- Language: JavaScript
- Homepage: https://NetBr3ak.github.io/rock-paper-scissors/
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# đǍđâī¸ Rock Paper Scissors Game
Welcome to the **Rock Paper Scissors Game**! This simple, classic game lets you challenge the computer in a fun and interactive way using HTML and JavaScript. Get ready for some competition!
## đ Getting Started
1. Open the HTML file in your web browser đ.
2. Follow the prompts to enter your choices đŗī¸.
3. Play five rounds against the computer and see who comes out on top! đ
Alternatively, you can access the game directly on GitHub Pages from my repository:
- Visit the [GitHub Pages of the game](https://NetBr3ak.github.io/rock-paper-scissors/) to play it online.
This link will take users directly to the hosted version of your game, making it easily accessible without the need for local setup.
## đ Project Structure
- **index.html**: Loads the game đŽ.
- **script.js**: Contains the game logic đ§ .
- **README.md**: Provides project information âšī¸.
- **LICENSE**: Contains the project's licensing information đ.
## đ Game Rules
1. Choose **Rock**, **Paper**, or **Scissors** âđâī¸.
2. The computer makes a random choice đ¤.
3. Determine the winner of each round:
- **Rock** beats **Scissors** â > âī¸
- **Paper** beats **Rock** đ > â
- **Scissors** beats **Paper** âī¸ > đ
4. Play 5 rounds. The player with the highest score wins! đĨ
## đ Code Overview
### Variables
- `let humanScore = 0;`: Tracks the player's score đ¯.
- `let computerScore = 0;`: Tracks the computer's score đģ.
### Functions
- `getComputerChoice()`: Returns the computer's random choice đ¤.
- `getHumanChoice()`: Prompts and returns the player's choice đŗī¸.
- `playRound(humanChoice, computerChoice)`: Determines the round winner and updates scores đ.
- `playGame()`: Runs the game for 5 rounds and declares the overall winner đ.
### Example Output
```javascript
You: Rock
Computer: Scissors
You win this round!
Rock beats Scissors - Point for you
Current match result: 1 - 0
...
Computer wins this tournament!
```
## đ¨ Styling
Console messages use basic styling for clarity:
- Green for player wins đĸ
- Yellow for draws đĄ
- Red for computer wins đ´
```javascript
console.log('%c You win this tournament! ', 'background: #222; color: #bada55');
console.log('%c Draw, nobody wins this tournament! ', 'background: #222; color: #ffff00');
console.log('%c Computer wins this tournament! ', 'background: #222; color: #ff4500');
```
## đ¤ Contributing
To contribute, fork the repository and submit a pull request. Your suggestions and improvements are welcomed with open arms! đ¤
## đ License
This project is open-source under the MIT License.
---
### Author
Created with â¤ī¸ by T3aC0d3. Have any questions or feedback? Feel free to reach out!
---
Let the games begin! đ