Last active
May 18, 2021 16:39
-
-
Save Loreen-netizen/1db3ee0dd8ce8bfbdb97a73b6bd509fe 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* | |
Inactive | |
Switch On->Active | |
Active | |
Switch Off->Inactive | |
New Order | |
Select New Snack->Show Price | |
Timeout?->Inactive | |
Done->Inactive | |
Show Price | |
Coin Inserted->Coin Validation | |
No Coin Inserted->Inactive | |
Coin Validation | |
Coin Valid->Check Change | |
Coin Invalid->Error Message | |
Coin Validation Error->Error Message | |
Check Change | |
Change?->Dispensing | |
No Change->Dispensing | |
Error Message | |
Eject Coin->Dispensing | |
Time Out?->Inactive | |
Error?->Display Error Message | |
Display Error Message | |
New Coin Inserted->Coin Validation | |
Time Out?->Inactive | |
Dispensing | |
Snack Released->New Order | |
Release Change And Snack->New Order | |
Release Invalid Coin ->Show Price | |
Time Out?->Inactive | |
New Snack Selected->Show Price | |
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