code wiki / _hdl_build / _pe_draft.nx
_pe_draft.nx source
↩ module page · 10 lines · 479 B
1// AUTHORED BY THE NISHI BUILDER (pattern: STATE_FLOW) -- transitions-table state machine, no Claude logic
2// -1 = ILLEGAL transition (refused, caller must handle). Table is the single source of truth.
3import "nx_syscalls.nx"
4func _pe_draft_step(state: i64, ev: i64) -> i64 {
5 if state == 0 { if ev == 0 { return 1 } }
6 if state == 1 { if ev == 0 { return 1 } }
7 if state == 1 { if ev == 1 { return 0 } }
8 if state == 1 { if ev == 2 { return 0 } }
9 return 0 - 1
10}