Finite state machine: Difference between revisions

m
→‎{{header|C++}}: Minor rewording of prompt
(Example and explanation provided)
m (→‎{{header|C++}}: Minor rewording of prompt)
Line 187:
options += transition;
}
print("[" + state + "] Input the next transition (" + options + "): ");
string
transition;
Line 201:
<pre>
Please deposit coins.
[ready] Enter the next transition (deposit, quit):
> deposit
Please select a product.
[waiting] Enter the next transition (refund, select):
> refund
Refunding money...
Please deposit coins.
[ready] Enter the next transition (deposit, quit):
> deposit
Please select a product.
[waiting] Enter the next transition (refund, select):
> select
Dispensed...please remove product from tray.
[dispense] Enter the next transition (remove):
> remove
Please deposit coins.
[ready] Enter the next transition (deposit, quit):
> quit
</pre>
41

edits