Example kalah game implementation using Micronaut, RuleBook and Quasar Actors.
- When the application receives a request to create a new game, it spawns a new
GameActor. After that for each game-related action is routed to correspondingGameActor. - There is no persistence and error handling.
- RuleBook used to implement rules as the chain of responsibility under
com.serdarormanli.kalah.rulespackage. - Default number of pits per player and number of stones per pit is configurable. They can be overridden in
application.yaml. - Rest api served at
localhost:8080/kalahby default. - Rest api has 3 resources.
/kalah POSTcreates new game returns board. TakesnumberOfPitsPerPlayerandnumberOfStonesPerPitas optional query parameters./kalah/{gameId} GETreturns latest snapshot of game./kalah/{gameId}/indexOfPit/{indexOfPit} POSTpicks stones and distributes. Returns latest snapshot of the game.- There is a basic frontend served at
localhost:8080by default.
- Java 11
- Micronaut
- Quasar
- RuleBook