Skip to content

An object-oriented approach to the rock-paper-scissors game

Notifications You must be signed in to change notification settings

nileshsah/rock-paper-scissors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Rock Paper Scissors Game

An Object Oriented Design implementation of the famous game Rock Paper Scissors

Compiling

In order to compile the project, you'll require JDK 11 and Maven 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 rock-paper-scissors

Running

Once compiled, the game can then be started in multiple ways.

  • Using Maven exec plugin: While being on the root folder rock-paper-scissors, run the command:
 mvn exec:java
  • Using generated jar file: The game can also be executed directly via the jar file generated in the target folder. While being on the root folder rock-paper-scissors, run the command:
java -jar target/rock-paper-scissors-1.0-jar-with-dependencies.jar

Game Play Example

Welcome to the Game of (Rock/Paper/Scissors) xxxxx[;;;;;;;;;>

Ready Player (#One)?
Enter your name: Subzero

Enter number of rounds: 2

Game #1 of 2
Choose your move (Rock, Paper, Scissors): Rock
Subzero chooses ROCK
ShaoKahn chooses PAPER
(Mortal Kombat voice) FATALITY! ShaoKahn WINS! 

Game #2 of 2
Choose your move (Rock, Paper, Scissors): Paper
Subzero chooses PAPER
ShaoKahn chooses ROCK
(Mortal Kombat voice) FATALITY! Subzero WINS!

About

An object-oriented approach to the rock-paper-scissors game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages