https://github.com/rcsoyer/console-game
rock-paper-scissors console game
https://github.com/rcsoyer/console-game
cli console-application console-game gradle java21
Last synced: 15 days ago
JSON representation
rock-paper-scissors console game
- Host: GitHub
- URL: https://github.com/rcsoyer/console-game
- Owner: rcsoyer
- Created: 2021-03-06T15:42:34.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-01-13T10:11:34.000Z (over 1 year ago)
- Last Synced: 2025-01-13T11:27:04.630Z (over 1 year ago)
- Topics: cli, console-application, console-game, gradle, java21
- Language: Java
- Homepage:
- Size: 153 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# console-game rock-paper-scissors
### About
Simple interactive console application to play the game rock-paper-scissors.
The game is user (on input via console) against random (not vicious) machine hand
### Run the app
This Java projects uses JDK 21.
The JDK must be configured accordingly on local machine
#### Command line
* ./gradlew clean build - build the application
* gradle run - run the app via gradle command line
#### IntelliJ IDEA
* Configure the project to point to a JDK 21 available on the local machine.
* The project uses Lombok hence it must be enabled Annotation Processors.
* Run the main class [GameApp](src/main/java/org/acme/game/GameApp.java)
### Game rules
The winner is determined by the following schema:
* Paper beats (wraps) rock
* Rock beats (blunts) scissors
* Scissors beats (cuts) paper
### Play the app
To play the game the user must input, from console, only int values on range as described the
actions:
* 1 - user informs that it is playing PAPER
* 2 - user informs that it is playing ROCK
* 3 - user informs that it is playing SCISSORS
* 0 - user informs that wants to finish the game
The user can play as any matches as they want to.
If the user type on console any other value, besides above mentioned, the program exits with
error
See: [HandOptions](src/main/java/org/acme/game/domain/Hand.java)