B4Coder

🚦 Traffic Junction (Simulation) · Mission 4 of 5

🚗 Busy Road

Rush hour: east–west is packed, north–south is quiet. A plain timer gets only about 70 cars through in a minute. Use the car counts to get at least 90 through, without anyone waiting more than 20 seconds.

Your mission

  1. Both red (the start): ns = "green".
  2. Keep every green for at least 5 seconds (sim.seconds >= 5).
  3. After that, switch to the other road if it has more cars waiting (sim.waitingNS, sim.waitingEW), or if this green has lasted 15 seconds, so the quiet road isn't forgotten.

Getting the mission ready…