This is a simple implementation of the boomerang Australia game. It is implemented using ratatui
and tokio
among other libraries.
The app is heavily multi threaded and this is for good reason, the idea is to separate out all of the game logic from the rest of the logic allowing for easy modifications in the future. By using message passing in between threads instead of interfaces in sync code we further reduce the coupling between structs at the cost of some complexity in error handling.
Furthermore the game rules are implemented as states in a finite state machine,
allowing for interchangeable rule sets.
The rule set that is currently implemented can be represented like so
f All of the code that is specific to boomerang australia is located in src, all other code (server,tui) is agnostic to the rules or even the intended application. The tui crate defines interface related traits and an async runtime for a frontend. The server defines server and message passing things as well as a runtime for a async backend.
To run the code, first in one terminal, ensure that the server is running
cargo build --release && ./target/release/boomerang -m server
Then in at least two other terminals
cargo build --release && ./target/release/boomerang -m client