This is a simulation of the game UNO.
Make a Uno
and call run
:
val game = new Uno(numPlayers = 3)
val results = game.run
run
is a Stream[GameState]
which contains all changes to the game's state from start to finish.
It's also published to bintray as a library, get it in sbt with:
externalResolvers += Resolver.bintrayRepo("dougietech", "dougietech")
libraryDependencies += "tech.dougie" %% "uno" % "<current-version>"
The current version is at the top of this page.
There's an example of using it it here. You can run it with sbt it/test
.
- The default strategies are not very sophisticated.
- The entire rule about a player yelling "UNO" is not taken into account.
- No support for custom rules, e.g. "Progressive" Uno (where draw cards and skips can be "chained")
The UNO game, its trademark, and brand is the property of Mattel, Inc. This code is licensed under the MIT License.