An implementation of Towers of Hanoi written in Elixir.
Features
- Simple example of how to use phoenix live-view, genserver and tailwind
- Can play yourself (manual mode) or be shown how to do it (auto-play)
- Tracks how many steps are taken to complete
- Can run locally or be built into a docker image
- Decent test coverage inc static analysis with dialyzer
- API documentation including architecture diagrams
When I was learning elixir, the examples I saw felt ideomatically OO (e.g. [1]) rather than functional so I decided to write one myself, leaning into FP. Having got the CLI running, I didn't stop there and ended up building a LiveView web-app because, why not?
Obviously having written this as a critique of structure - feel free to comment on what I have done. All greatfully accepted.
Full details on how to run either as a webapp, gen_server or command line can be on this page.