The Circle Track
Objective:
Objective:
Build a circle track like on the picture below. Start at the train station, make 3 laps and stop driving at the station.
Sample Solution:
Sample Solution:
This program uses the smart train's distance control. Since this track is a perfect circle, the track's length can be calculated using the π*diameter formula. When the train travels this distance, the lap flag variable is set to 1 and the repeat loop resets the distance to 0. After the 3 laps are complete, the train stops. The sounds and light animations in the program are used to punctuate the train's actions.