What is a state machine, and why should I use one? State machines are a way of organizing code into situations, or states, and transitions so that the code is easier to follow and read. A state represents what the code and/or physical machine is curr...