This is a simple Rock-Paper-Scissors game implemented in Java. The game allows a user to play against the computer as well as another player, which randomly selects its move. It also allows for multiple rounds of play and keeps track of the score.
I structured the code myself, focusing on clarity and maintainability of the classes/files.
- Play against the computer or another player
- Multiple rounds of play
- Score tracking
- User-friendly interface Console application
- Random move selection for the computer player
- Input validation for user choices
- Option to exit the game
- model: Contains the entities, value object classes for the game.
- ui: Contains the user interface classes for interacting with the player.
- repository: Contains the classes for managing game data.
- service: Contains the service classes for handling game operations and player interactions.
- openjdk java 23
- JUnit 5.13 for unit testing
- Maven for dependency management
- Git for version control + GitHub for repository.repository hosting
- IntelliJ IDEA as the IDE for local development
- Ensure you have Java installed on your machine.
- Clone the repository link or download the source code (zip file).
- Open a terminal or command prompt.
- Navigate to the directory where the source code is located.
- Run the game using the command, Build the project first using Maven:
`mvn clean install`## in case to run using .jar -> $(which java) -jar target/Game-1.0-SNAPSHOT.jar $(which java) -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath target/classes RockPaperScissors
- Choose to play against the computer or another player.
- Select your move: Rock, Paper, or Scissors. Note that you can also use the emojis representations:
- Rock: ✊
- Paper: ✋
- Scissors: ✌️ and You can even use the first letter of each (r, p, s) as well.
- The computer or the other player will randomly select its move.
- The game will determine the winner based on the rules of Rock-Paper-Scissors:
- Rock beats Scissors
- Scissors beats Paper
- Paper beats Rock
- If both players choose the same move, it is a tie.
- The game will display the result of each round and update the score accordingly.
- Implement a graphical user interface (GUI) for a more interactive experience.
- Implement a tutorial mode for new players.
- Add more game modes or Currently only { Easy and Hard }.
- Add sound effects and animations for a more engaging experience.
- Implement a multiplayer mode over a network and Implement a leaderboard.
- Add Localization support for different languages.
- Implement a save/load feature to continue games later.