State Machines

All a state machine is is a loop that has some/all parts that run on the value of a variable.

The rest is in how you do it though keep in mind that any task has a least amount of work to accomplish, it's funny how many people not-think/supposed-to a whole lot of extra steps to do the same job.