ELI5: Explain Like I'm 5

Finite-state machine

A finite-state machine is like a system or device that can remember a few things or states. It works by going from one state to another depending on what it sees or hears. For example, if you are making something with a vending machine, the machine changes states: When you first make a selection, it is in the "Waiting for Coin" state. But when you put money into the machine, it changes to the "Coin Accepted" state. Then, when you press the button for your selection, the machine changes to the "Dispensing Item" state. This is just one example of how a finite-state machine works.