Concept Flow - State transition table approach
Start
Current State
Input Event
Look up next state & action in table
Perform action
Update current state
Wait for next input or exit
The program starts with a current state and input event, looks up the next state and action in a table, performs the action, updates the state, and repeats.