Turnstile
Finite State Machines
If you’ve never encountered finite state machine (FSM) modelling before, here is what it looks like.
The following state machine is comprised of two states: “State 1” and “State 2”. There is a single event “event_name” that can take the state machine from State 1 to State 2.
One use case of FSMs is User Interface logic, consider the following:
Each event of the finite state machine can be bound to application methods e.g.
The Kata
Build a finite state machine from scratch, that replicates the following Finite State Machine
Once you have completed that, continue on to part 2 (remember the point is to learn about the impact of changing requirements, so no peeking!) you can find part 2 here