Finite State Machines

Source Code on GitHub.