Traffic Light Simulation
File Handling & SimulationSimulation
MOD
A traffic light repeats a 12-second cycle:
- Seconds 0 to 4: `Green`
- Seconds 5 and 6: `Amber`
- Seconds 7 to 11: `Red`
After second 11 the cycle starts again at second 0. Write a program that inputs the number of seconds `t` since the simulation started (a non-negative integer) and outputs the colour of the light at that moment.
For example, at `t` = 30 the light is `Amber`.
Example Input
3
Example Output
Green
0% (0 passed / 0 attempted)