Anfang A2b4
This commit is contained in:
parent
1931b23be0
commit
831e723d92
|
@ -47,13 +47,15 @@ proc
|
||||||
TrafficLight(direction : CardinalDirection) = TL(direction, red);
|
TrafficLight(direction : CardinalDirection) = TL(direction, red);
|
||||||
|
|
||||||
TL(direction : CardinalDirection, colour : Colour) =
|
TL(direction : CardinalDirection, colour : Colour) =
|
||||||
|
show(direction, colour).
|
||||||
(colour == red)
|
(colour == red)
|
||||||
-> changeDirection(nextDirection(direction)) . TL(direction, nextColour(colour))
|
-> ChangeLight(direction, colour)
|
||||||
<> changeLight(nextColour(colour)) . show(direction, nextColour(colour)) . TL(direction, nextColour(colour))
|
<> changeDirection(nextDirection(direction)) . ChangeLight(direction, colour)
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
ChangeLight(direction : CardinalDirection, colour : Colour) =
|
||||||
|
changeLight(nextColour(colour)) . TL(direction, nextColour(colour))
|
||||||
|
;
|
||||||
|
|
||||||
System =
|
System =
|
||||||
allow({
|
allow({
|
||||||
|
@ -70,7 +72,7 @@ proc
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
TrafficLight(north) || TrafficLight(east) || TrafficLight(south) || TrafficLight(west)
|
TrafficLight(north) || TrafficLight(east) || TrafficLight(south) || TrafficLight(west) || changeDirection(north) || changeDirection(south)
|
||||||
));
|
));
|
||||||
|
|
||||||
init
|
init
|
Loading…
Reference in New Issue