Anfang A2b4

This commit is contained in:
Johannes Theiner 2020-05-09 19:33:04 +02:00
parent 1931b23be0
commit 831e723d92
22 changed files with 7 additions and 5 deletions

View File

@ -47,13 +47,15 @@ proc
TrafficLight(direction : CardinalDirection) = TL(direction, red);
TL(direction : CardinalDirection, colour : Colour) =
show(direction, colour).
(colour == red)
-> changeDirection(nextDirection(direction)) . TL(direction, nextColour(colour))
<> changeLight(nextColour(colour)) . show(direction, nextColour(colour)) . TL(direction, nextColour(colour))
-> ChangeLight(direction, colour)
<> changeDirection(nextDirection(direction)) . ChangeLight(direction, colour)
;
ChangeLight(direction : CardinalDirection, colour : Colour) =
changeLight(nextColour(colour)) . TL(direction, nextColour(colour))
;
System =
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