Settings

Theme

Spacydo: State machine example with own calldata for state transition rules

1 points by tracyspacy 16 days ago · 0 comments · 1 min read


In this example Traffic Light task is a simple state machine which has it's own state transition rules in calldata that executes by vm on each task's instructions call.

VM has persistent storage, so state is persistent across calls

Calldata logic: check task's state -> transit to next -> save. State transition rule: 0(Green)->1(Yellow)->2(Red)->0(Green).

examples code: https://github.com/tracyspacy/spacydo/blob/main/examples/traffic_light

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection