Last active
July 1, 2020 18:50
-
-
Save tcoopman/ce0d10acd51cc82aa852c696b36ae814 to your computer and use it in GitHub Desktop.
Vending Machine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vending Machine | |
OrderProcessStarted | |
WaitingForMoney* | |
insert coin -> validating coin | |
select product -> validating selection | |
request return coins -> returning coins | |
validating coin | |
valid -> WaitingForMoney | |
invalid -> Returning Coin | |
validating selection | |
product available? -> validating price | |
product not available? -> WaitingForMoney | |
validating price | |
exact coins? -> dispensing product | |
too many coins? -> returning change | |
not enough coins? -> WaitingForMoney | |
Returning Coin | |
return coin -> WaitingForMoney | |
returning change | |
return coin -> dispensing product | |
returning coins | |
returning all coins -> WaitingForMoney | |
dispensing product | |
dispense -> WaitingForMoney |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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