A standalone command-line UNO-like game written in Java.
This repository is set up as a standard Maven project with automated tests, logging of important game events, and Docker support.
- Java 21 (JDK)
- Maven is not required to be installed: a Maven Wrapper (
mvnw/mvnw.cmd) is included and will download the correct Maven version automatically. - Docker (optional, only for the Docker workflow)
On Linux/macOS use
./mvnw. On Windows use.\mvnw.cmd(ormvnw.cmd). If you already have Maven installed, you can replace./mvnwwithmvn.
pom.xml Maven build configuration
Dockerfile Multi-stage build + run image
src/main/java/ Application source (default package)
src/test/java/ JUnit 5 tests
The main class is Main.
./mvnw clean compileWindows:
.\mvnw.cmd clean compileRuns the JUnit suite, which executes all existing characterization checks through Maven Surefire (no manual classpath setup).
./mvnw testWindows:
.\mvnw.cmd testProduces the executable jar at target/uno-cli.jar (runs tests first).
./mvnw clean packageWindows:
.\mvnw.cmd clean packageRun the packaged jar:
java -jar target/uno-cli.jar --bots 3 --games 1 --quietOr run directly through Maven without packaging:
./mvnw -q compile exec:java -Dexec.args="--bots 3 --games 1 --quiet"Interactive game vs. bots:
java -jar target/uno-cli.jar --human --bots 2 --games 1Available arguments: --bots N, --games N, --human, --quiet, --seed N,
--report, --limit N, --no-persist, --self-test, --help.
Completed games are saved to a local database (see
docs/database.md). View the reports with:
java -jar target/uno-cli.jar --report
java -jar target/uno-cli.jar --report --limit 5This prints recent games, player win counts, and highest scores.
docker build -t uno-cli .Non-interactive bot game (uses the image default arguments):
docker run --rm uno-cliPass custom arguments:
docker run --rm uno-cli --bots 4 --games 3 --quietInteractive game (allocate a TTY so the game can read your input):
docker run --rm -it uno-cli --human --bots 2 --games 1The game uses java.util.logging. Important events are logged to
logs/uno.log (created on first run):
- game start
- player turn
- card played
- card drawn
- invalid input
- round/game end
Logs are written to the log file only, so normal player-facing CLI output on the console stays clean and readable.
Game results are persisted with Hibernate ORM (JPA) into an embedded H2
database (./data/uno.mv.db). Players, games, rounds, per-player scores, the
winner, and timestamps are all stored, and three report queries are available
via --report. Tests run against an isolated in-memory H2 database.
Full details (schema, configuration, credentials/overrides, how to run the
persistence tests, and how to view statistics) are in
docs/database.md.
R5 red 5
YS yellow skip
BR blue reverse
G+2 green draw two
W wild
W4 wild draw four
draw draw a card
See docs/rules.html for the implemented game rules.