Traffic Lights

In this exercise we will model a simple traffic light as it cycles through it's colors.

Variables

The spec should contain a single variable called light.

Initial State

Initially the light should be yellow.

Transitions

  • If the light is red, it should be green in the next state.
  • If the light is green, it should be yellow in the next state.
  • If the light is yellow, it should be red in the next state.
traffic-lights
Ready
⌘↵ to submit