Search⌘ K

Exercise: Pedestrian Movement

Understand how to use variants, constructors, and option types in ReasonML by implementing a pedestrian function that reacts to different car states. This exercise strengthens your skills in handling optional data and control flow for practical scenarios.

Problem Statement

In this exercise, we will try to recreate a pedestrian crossing at a traffic stop. You have to write the pedestrian() function which takes a car variable as its argument. The car variable will be of the ...