http://www.perlmonks.org?node_id=413256


in reply to Re: Are state machines just for parsing?
in thread Are state machines just for parsing?

It occured to me that it might be beneficial to show the state transition diagram for the above state machine.
+--------------------------------------------------+ | | | _______ | | left / \ right | | +------------|initial|-----------------+ | | | \_______/ | | | | | | | | +--------+ | | | ___V___ | | | | |left / \ right | _V__V_V_ +-----| red |--------------+ | left / \ right \_______/ | +------| blue |------+ ^ | \________/ | | | | | | | | __V____ | | left / \ right | | +-----| end |------+ | | | \_______/ | | | | ^ ^ | | | | | | | | | +-------+ +---------+ | | | +-------------------------------------------------+


-- All code is 100% tested and functional unless otherwise noted.