#include "library.h" const double limit = 0.5; double line(const double length) { if (length > limit) { const double third = length/3; const double a = line(third); turn_left_by_degrees(60); const double b = line(third); turn_right_by_degrees(120); const double c = line(third); turn_left_by_degrees(60); const double d = line(third); return a + b + c + d; } else { draw_distance(length); return length; } } void main() { make_window(600, 600); move_to(100, 150); set_heading_degrees(90); set_pen_width(3); const double a = line(400); turn_right_by_degrees(120); const double b = line(400); turn_right_by_degrees(120); const double c = line(400); turn_right_by_degrees(120); print("total length "); print(a + b + c); new_line(); }