Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 

Repository files navigation

RockPaperScissors-Java

πŸͺ¨πŸ—žοΈβœ‚️ 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.


πŸ”§ How it Works

  1. The game runs for 3 rounds.
  2. For each round:
    • You enter your choice as a number:
      • 1 = Rock
      • 2 = Paper
      • 3 = Scissors
    • The computer randomly selects its choice.
  3. 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.
  4. Scores are updated after each round.
  5. After 3 rounds, the program displays:
    • Total score for you
    • Total score for Jarvis
    • Number of draws
    • Overall winner

🧠 What I Practiced in This Project

  • Using arrays to store options (Rock, Paper, Scissors).
  • Loops (for loop) for multiple rounds.
  • Random number generation for computer choice.
  • Input validation using while loops.
  • Conditionals (if-else) to determine round winner.
  • Formatted output using System.out.println.

πŸ’» Running the Code

  1. Make sure Java JDK is installed.
  2. Save the code as RockPaperScissorsGame.java.
  3. Open a terminal or command prompt in the code directory.
  4. Compile the code:
javac RockPaperScissorsGame.java

About

A simple console-based Rock-Paper-Scissors game in Java. Play against the computer for 3 rounds with live scoring and overall winner display.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages