Chapter 12. State Machines

“Is That a Gizmo in Your Pocket, Or …”

Consider a coin-operated machine that accepts nickels and dimes[1] and, for the princely sum of fifteen cents, dispenses some useful article called a “gizmo” that the well-dressed man-about-town could not possibly be without.[2] We may consider such a machine to comprise three main blocks: a receiver that accepts money, a dispenser that dispenses the “gizmo” along with any change, and a controller that oversees everything and makes sure things function as planned (Figure 12.1).

1 For the benefit of those readers who do not reside in the United States, nickels and dimes are American coins worth five and ten cents, respectively.

2 I always carry two in case of an emergency.

Get Bebop to the Boolean Boogie, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.