Hacker News new | past | comments | ask | show | jobs | submit login

Ah, for illustration purposes this is showing a "one-shot" button. Notice the "fire" state is a double circle -- this means that it's a terminal state for the state machine, meaning the state machine is "done" once it enters that. In practice, the fire state would be wired up to the start state of another state machine, which would be wired up to the start state of the button machine to get things going again. The "Click to Reset", notice, isn't part of the state machine itself, and instead it's modeling the stuff that happens between firing and transitioning back through "start."

A button that has no "on click," so to speak, could be represented by having the fire state transition immediately back through "start."




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: