News for hackers. Stuff that matters.
Re:Facts about State Machines by userbinator on Friday September 30, 2022 @10:14PM (#33043151)
Of all the other replies, it's interesting that no one has mentioned the simplest and probably most efficient implementation, the one based on gotos:

    state_x:
        ... do some stuff ...
        if(some_condition)
            goto state_y;
        else if(some_other_condition)
            goto state_z;
        else
            goto state_n;
        ...
    state_y:
        ...

There are no comments on this comment yet.