A2b4 fertig
This commit is contained in:
parent
ba8cc850c7
commit
e16a069d09
Binary file not shown.
Binary file not shown.
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user