B4Coder

🚦 Traffic Junction (Simulation) · Mission 3 of 5

🟡 Yellow Light

Going straight from green to red is dangerous: drivers need a warning. Green should turn yellow for 3 seconds, then red.

Your mission

  1. Both red (the start): ns = "green".
  2. sim.ns == "green" and 10 seconds gone: ns = "yellow". sim.ns == "yellow" and 3 seconds gone: ns = "red", ew = "green".
  3. The same for east–west: green → yellow after 10 s, then red and north–south green after 3 s.

Getting the mission ready…