How to implement Finite State Machines into a CC

First a brief review of what a Finite State Machine (FSM) is https://medium.com/@mlbors/what-is-a-finite-state-machine-6d8dec727e2c