A small Uno game built to explore modeling a domain with Funx.
-
Run
mix setupto install and set up dependencies -
Start the Phoenix endpoint with
mix phx.server- or in IEx with
iex -S mix phx.server
- or in IEx with
Then visit http://localhost:4000.
lib/uno/card.ex: card struct and helperslib/uno/hand.ex: hand managementlib/uno/game.ex: aggregate root and state transitionslib/uno/rules.ex: domain rules: predicates and orderinglib/uno/action/*.ex: action modules (draw, skip, reverse, etc.)lib/uno/validator/*.ex: domain validatorslib/uno/service.ex: application service entry pointslib/uno/bot.ex: bot player logiclib/uno/store.ex: game state storagelib/uno_web/components/*: UI componentslib/uno_web/live/game/*: LiveView UI
If any of these conditions are violated, the state is impossible. This indicates a bug and the process should crash.
- Game creation must be valid
- Discard pile is never empty
- Every player must have a hand
- A played card must exist in the player’s hand
- Draw effects will have enough cards after reshuffle