Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Facts about State Machines. Parent comment
# (state, event) => (next state, action) FSM = {}
# Simple left down-[move*]-up sequences. FSM[STATE.clear, EVENT.left_down ] = STATE.set_caret, 'set_insertion_point' FSM[STATE.set_caret, EVENT.left_motion] = STATE.set_caret, 'set_insertion_point' FSM[STATE.set_caret, EVENT.left_up ] = STATE.clear, 'nothing'
new_state, action = FSM[state, event]
There is also a DOT file (and SVG image) of the resulting state graph (the code to generate the DOT file directly from the FSM dict is at the bottom of the mousebindings.py file.)
There are no comments on this comment yet.
There is also a DOT file (and SVG image) of the resulting state graph (the code to generate the DOT file directly from the FSM dict is at the bottom of the mousebindings.py file.)