🚦 Traffic Junction (Simulation) · Mission 2 of 5
🔁 Take Turns
Fair is fair: each road should get 10 seconds of green, then the other road's turn.
Your mission
- At the start both lights are red: if sim.ns == "red" && sim.ew == "red", make ns = "green".
- When sim.seconds >= 10, swap: if sim.ns == "green", then ns = "red" and ew = "green"; otherwise ns = "green" and ew = "red".
- Otherwise change nothing: the lights stay as they are.
Getting the mission ready…