A finite state machine library
Add this to your application's shard.yml
:
dependencies:
fsm:
github: N0r1x/fsm
require "fsm"
Include Fsm
Include the module Fsm to be able to access it's class FiniteStateMachine. You need to input the branches of the states in a tuple of form id : String | input : T| id_of_next_state_if_input| output :O The program will crash if input is submitted that the current state can't handle.
Add a Moore machine class as well. Check input.
- Fork it ( https://github.com/N0r1x/fsm/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- N0r1x N0r1x - creator, maintainer