View Source Hanoi.Board (Towers of Hanoi v1.0.0)
The domain model.
The type and functions that define and create the domain data model
Summary
Functions
Recommended way to set up the inital board with stones on left
Generally used by test code, set up stack of stones. You are required to set up your own board still.
Returns true if the game is complete. That is all the stones are on the right pile in correct order
Types
A hanoi board formed of three piles of stones.
Functions
@spec create_board(stones :: pos_integer()) :: t()
Recommended way to set up the inital board with stones on left
@spec create_loaded_stack(stones :: pos_integer()) :: list()
Generally used by test code, set up stack of stones. You are required to set up your own board still.
@spec is_complete(board :: t(), stones :: pos_integer()) :: boolean()
Returns true if the game is complete. That is all the stones are on the right pile in correct order