B4Coder

🚦 Traffic Junction (Simulation) · Mission 5 of 5

🚑 Ambulance!

Two ambulances will come through this minute. When one is waiting, its road must get green straight away, and the other road red. Otherwise, take turns as usual.

Your mission

  1. First: if sim.ambulance == "ns", ns = "green" and ew = "red". If sim.ambulance == "ew", the other way round.
  2. Otherwise: take turns every 10 seconds, like mission 2.
  3. An ambulance may wait at most 2 seconds.

Getting the mission ready…