Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 586 Bytes

File metadata and controls

16 lines (12 loc) · 586 Bytes

Traffic Light Challenge

Problem Description

Create a simulated traffic light. The traffic light should cycle through red, yellow, and green lights automatically, mimicking the behavior of a real traffic signal.

Requirements

  1. Display three lights: red, yellow, and green.
  2. Automatically cycle through the lights in the correct order (green -> yellow -> red -> green).
  3. Each light should stay active for a set duration:
    • Green: 3 seconds
    • Yellow: 1 second
    • Red: 4 seconds
  4. Only one light should be active at a time.
  5. The cycle should repeat indefinitely.