[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: finite state machine in lua
- From: "Soni \"They/Them\" L." <fakedme@...>
- Date: Sun, 28 Apr 2019 22:06:22 -0300
On 2019-04-28 9:44 p.m., Jorge wrote:
On 28/4/19 17:32, Sean Conner wrote:
Personally, I tend to use mutually recursive functions to handle state
machines in Lua.
I've used that and it works great, very compact and efficient. An
explicit data structure with states, transitions, etc. is easier to
explain to others and to manipulate programmatically, tough.
If you need more sophisticated state machines, like hierarchical state
machines / statecharts, you can check this:
(it's a very light weight implementation, we use it on
I sort of made my own thing I guess?
https://cybre.tech/SoniEx2/lua.cratera/ (this repo's a mess, but
basically look at parser.lua and luatokens.lua and I guess compiler.lua
I don't recommend it, it's just something to look at from a distance tbh...
... a great great distance.