From 45b78401e8c224619e1b18b9cf43fc02b196676e Mon Sep 17 00:00:00 2001 From: ptmcg Date: Fri, 28 Dec 2018 14:42:07 -0600 Subject: Fix partial named results when And embedded in named MatchFirst or Or --- examples/statemachine/trafficLightDemo.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 examples/statemachine/trafficLightDemo.py (limited to 'examples/statemachine/trafficLightDemo.py') diff --git a/examples/statemachine/trafficLightDemo.py b/examples/statemachine/trafficLightDemo.py new file mode 100644 index 0000000..30fe934 --- /dev/null +++ b/examples/statemachine/trafficLightDemo.py @@ -0,0 +1,12 @@ +import statemachine +import trafficlight + +tl = trafficLight.Red() +for i in range(10): + print(tl, end='') + print(("STOP", "GO")[tl.carsCanGo]) + tl.crossingSignal() + tl.delay() + print() + + tl = tl.nextState() -- cgit v1.2.1