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;
changeDirection: CardinalDirection;
changedDirection: CardinalDirection;
emptyAct;
wait;
proceed;
%------------------------------------------------------------------------
@ -52,7 +53,7 @@ proc
<> %ansonsten
show(direction, colour) . %aktuellen Zustand zeigen
(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) %ansonsten zum nächsten Zustand wechseln.
@ -69,22 +70,27 @@ proc
;
System =
hide({%unnötige Informationen verstecken
proceed,
changedDirection,
changedLight
},
allow({
show,
%changeLight,
changedLight,
%changeDirection,
changedDirection,
emptyAct
proceed
},
comm({
changeDirection | changeDirection -> changedDirection,
changeLight | changeLight -> changedLight
changeLight | changeLight -> changedLight,
wait | wait -> proceed
},
TrafficLight(north) || TrafficLight(east) || TrafficLight(south) || TrafficLight(west) || changeDirection(north) || changeDirection(south)
%starten der Prozesse und auslösen des ersten Richtungswechsels
));
)));
init
System