A2b4 fertig

This commit is contained in:
Johannes Theiner 2020-05-10 12:43:31 +02:00
parent ba8cc850c7
commit e16a069d09
3 changed files with 13 additions and 7 deletions

Binary file not shown.

Binary file not shown.

View File

@ -39,7 +39,8 @@ act
changedLight: Colour; changedLight: Colour;
changeDirection: CardinalDirection; changeDirection: CardinalDirection;
changedDirection: CardinalDirection; changedDirection: CardinalDirection;
emptyAct; wait;
proceed;
%------------------------------------------------------------------------ %------------------------------------------------------------------------
@ -52,7 +53,7 @@ proc
<> %ansonsten <> %ansonsten
show(direction, colour) . %aktuellen Zustand zeigen show(direction, colour) . %aktuellen Zustand zeigen
(colour == red) %wenn rot (colour == red) %wenn rot
-> ChangeDirection(direction) %Richtungswechsel, wenn wieder zurück -> wait . ChangeDirection(direction) %Richtungswechsel, wenn wieder zurück
. ChangeLight(direction, colour) % -> zur nächsten Farbe wechseln. . ChangeLight(direction, colour) % -> zur nächsten Farbe wechseln.
<> ChangeLight(direction, colour) %ansonsten zum nächsten Zustand wechseln. <> ChangeLight(direction, colour) %ansonsten zum nächsten Zustand wechseln.
@ -69,22 +70,27 @@ proc
; ;
System = System =
hide({%unnötige Informationen verstecken
proceed,
changedDirection,
changedLight
},
allow({ allow({
show, show,
%changeLight,
changedLight, changedLight,
%changeDirection,
changedDirection, changedDirection,
emptyAct proceed
}, },
comm({ comm({
changeDirection | changeDirection -> changedDirection, changeDirection | changeDirection -> changedDirection,
changeLight | changeLight -> changedLight changeLight | changeLight -> changedLight,
wait | wait -> proceed
}, },
TrafficLight(north) || TrafficLight(east) || TrafficLight(south) || TrafficLight(west) || changeDirection(north) || changeDirection(south) TrafficLight(north) || TrafficLight(east) || TrafficLight(south) || TrafficLight(west) || changeDirection(north) || changeDirection(south)
%starten der Prozesse und auslösen des ersten Richtungswechsels %starten der Prozesse und auslösen des ersten Richtungswechsels
)); )));
init init
System System