πͺ¨ποΈβοΈ Rock Paper Scissors Game - Java (Beginner Project)
Hi! This is a simple Rock, Paper, Scissors game I created in Java.
The game allows a human player to play against the computer (Jarvis) for 3 rounds, keeping track of scores and declaring the overall winner.
It's a fun and interactive way to practice Java basics like loops, conditionals, arrays, and user input.
- The game runs for 3 rounds.
- For each round:
- You enter your choice as a number:
1 = Rock2 = Paper3 = Scissors
- The computer randomly selects its choice.
- You enter your choice as a number:
- The program compares your choice and the computer's:
- If the choices are the same β it's a draw.
- If your choice beats the computer β you win the round.
- Otherwise β computer wins the round.
- Scores are updated after each round.
- After 3 rounds, the program displays:
- Total score for you
- Total score for Jarvis
- Number of draws
- Overall winner
- Using arrays to store options (Rock, Paper, Scissors).
- Loops (
forloop) for multiple rounds. - Random number generation for computer choice.
- Input validation using
whileloops. - Conditionals (
if-else) to determine round winner. - Formatted output using
System.out.println.
- Make sure Java JDK is installed.
- Save the code as
RockPaperScissorsGame.java. - Open a terminal or command prompt in the code directory.
- Compile the code:
javac RockPaperScissorsGame.java