fsm

Version, currently master branch1 version
  • master branchlatestApr 2, 2017

github.com/N0r1x/fsm

A finite state machine library in Crystal

2 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  fsm:
    github: N0r1x/fsm
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
0.21.1
License
MIT
Author
N0r1x
Target
  • test from example/test.cr

Dependencies

This version declares no dependencies.

README

fsm

A finite state machine library

Installation

Add this to your application's shard.yml:

dependencies:
  fsm:
    github: N0r1x/fsm

Usage

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.

Development

Add a Moore machine class as well. Check input.

Contributing

  1. Fork it ( https://github.com/N0r1x/fsm/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • N0r1x N0r1x - creator, maintainer