Skip to content

Instantly share code, notes, and snippets.

@ddefb
Last active March 12, 2019 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddefb/50befbe0d4ef7176b486048125a7d9d6 to your computer and use it in GitHub Desktop.
Save ddefb/50befbe0d4ef7176b486048125a7d9d6 to your computer and use it in GitHub Desktop.
node movement(c: bool) returns (turning: bool; ombc:int)
var last mbc:int = 0;
let
ombc = mbc;
automaton
state MOVING do
mbc = 0;
turning = false;
unless not c then STURNING
state STURNING do
mbc = 0;
turning = true;
until not c then TURNING | c then MOVING
state TURNING do
mbc = last mbc + 1;
turning = true;
unless c & (12 = last mbc) then STURNING
end
tel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment