Fun with F# and turtle geometry

Heidi Mork

Workshop 1,5h

Turtle geometry is made from the viewpoint of a small turtle walking on an infinitely sized sheet of paper, leaving a trace where it walks. The turtle’s movements can be controlled by a small set of commands, like “move forward” and “turn”.

In this workshop you will learn basic functional programming with F#, while creating geometry. We will explore algebraic data types, pattern matching, functions and recursion, all to make the turtle move. We will make polygons, fractals and space filling curves, and look into some useful theorems for these geometric shapes. You can choose to concentrate on the F# tasks at hand, or you can allow yourself to be distracted by the beautiful geometry, and continue to explore different variants of the shapes.

The geometry in the workshop is based on the first chapters of the classical book “Turtle geometry” by Abelson and diSessa.

No previous experience with turtles or F# is required.