12345678910111213141516171819202122232425262728293031 |
- -- title: fsm
- -- author: pixelbath
- -- desc: test implementation of the barest-bones finite state machine
- local t = 0
- local state_update = nil
- function state1_update()
- print("state1_update()", 0, 16)
- if btnp(4) then
- state_update = state2_update
- end
- end
- function state2_update()
- print("state2_update()", 0, 16)
- if btnp(4) then
- state_update = state1_update
- end
- end
- state_update = state1_update
- function TIC()
- cls(0)
- state_update()
- end
- -- <PALETTE>
- -- 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
- -- </PALETTE>
|