Skip to content

Latest commit

 

History

History

traffic-light

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

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.