/RockPaperScissors

A comprehensive production ready implementation of a two player Rock Paper Scissors following SOLID principles.

Primary LanguageJava

Rock Paper Scissors Game

A comprehensive production ready implementation of a two player Rock Paper Scissors following SOLID principles.

Compiling

In order to compile the project, you'll require JDK 11 and Maven 3+ build tool to be installed and configured on your PC.

The project can be compiled and the required artifacts can be generated by running the command:

mvn clean install

while being on the root folder RockPaperScissors

Compiling and executing the app

To compile the project:

 mvn compile
  • Using Maven exec plugin: While being on the root folder rock-paper-scissors, run the command:
 mvn exec:java

or if not on the root folder:

mvn exec:java -Dexec.mainClass=RockPaperScissors

or the project can be easily setup as a maven project in Intellij or Eclipse and run as an application from the toolbar,

A sample demo

Welcome to Rock Paper Scissors Game!

Enter your name : 
robin

Game : 1 begins!
Play your move (Rock/Paper/Scissors). TYPE EXIT for exiting the game : rock
robin plays ROCK
Jun 14, 2022 8:25:53 PM utils.RPSLogger logInfo
INFO: Player : robin has played : ROCK
Jun 14, 2022 8:25:53 PM utils.RPSLogger logInfo
INFO: Computer with name : Deep Blue played : PAPER
Deep Blue plays PAPER
Score{computerScore=1, playerScore=0, draws=0}

Game : 2 begins!
Play your move (Rock/Paper/Scissors). TYPE EXIT for exiting the game : paper
robin plays PAPER
Jun 14, 2022 8:25:55 PM utils.RPSLogger logInfo
INFO: Player : robin has played : PAPER
Jun 14, 2022 8:25:55 PM utils.RPSLogger logInfo
INFO: Computer with name : Deep Blue played : SCISSORS
Deep Blue plays SCISSORS
Score{computerScore=2, playerScore=0, draws=0}

Game : 3 begins!
Play your move (Rock/Paper/Scissors). TYPE EXIT for exiting the game : paper
robin plays PAPER
Jun 14, 2022 8:25:58 PM utils.RPSLogger logInfo
INFO: Player : robin has played : PAPER
Jun 14, 2022 8:25:58 PM utils.RPSLogger logInfo
INFO: Computer with name : Deep Blue played : SCISSORS
Deep Blue plays SCISSORS
Score{computerScore=3, playerScore=0, draws=0}

Game : 4 begins!
Play your move (Rock/Paper/Scissors). TYPE EXIT for exiting the game : paper
robin plays PAPER
Jun 14, 2022 8:26:00 PM utils.RPSLogger logInfo
INFO: Player : robin has played : PAPER
Jun 14, 2022 8:26:00 PM utils.RPSLogger logInfo
INFO: Computer with name : Deep Blue played : ROCK
Deep Blue plays ROCK
Score{computerScore=3, playerScore=1, draws=0}

Game : 5 begins!
Play your move (Rock/Paper/Scissors). TYPE EXIT for exiting the game : exit
Shutting down the RPS application
Jun 14, 2022 8:27:10 PM utils.RPSLogger logInfo
INFO: Player : robin has played : EXIT
Jun 14, 2022 8:27:10 PM utils.RPSLogger logInfo
INFO: Computer with name : Deep Blue played : SCISSORS