Skip to content

Instantly share code, notes, and snippets.

@rschwabco
Last active June 6, 2021 22:17
Show Gist options
  • Save rschwabco/97987b1a9457522fc0d16a32253de5f2 to your computer and use it in GitHub Desktop.
Save rschwabco/97987b1a9457522fc0d16a32253de5f2 to your computer and use it in GitHub Desktop.
State Mahchine Building
State Mahchine Building
Prep
set title -> Set Title
Set Title
title set -> Enumerate States
Enumerate States
define state -> Define State
Define State
set name -> Set Name
define substates -> Enumerate States
Set Name
name set -> Enumerate Transitions
Enumerate Transitions
Define Transition
state does not exists? -> Define State
set from -> From set
From set
state does not exists? -> Define State
set to -> To set
add another? -> Define Transition
To set
done -> Enumerate Actions
Enumerate Actions
Define Action
add another action -> Enumerate Actions
done -> Review
Review
add another state -> Define State
done -> Set Initial State
Set Initial State
done -> Done
Done
function render(model){
let current_state_name = model.active_states[0].name;
return $("h1",
{style: {color: "darkBlue"}},
`The current state is: ${current_state_name}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment