Loop de loop patterns

The idea is that you consider a moving pointer, known as a "turtle". The turtle is given instructions to move around and the picture is made up of the turtle's track history. The set of rules that the turtle follows is:

the turtle moves along in a straight line a given distance. Here, the random numbers where used as the distances;

after moving each distance the turtle is turned 90 degrees to the right;

iterate the pattern until you get back to the beginning, or until you want to stop.

There are manywebsites that will allow you to produce such a picture using a programming language known as Logo.

For a simple example consider the list of numbers {50, 100, 150}. A single iteration of the Loop de Loop algorithm is given by

fd 50 rt 90 fd 100 rt 90 fd 150,

where "fd" means "go forward" the given amount and "rt" means "turn right" the given number of degrees. Following this set of instruction would produce a "J" type pattern, as shown below. Iterating the pattern can be done simply through

repeat 4[fd 50 rt 90 fd 100 rt 90 fd 150 rt 90].

This code will repeat the instructions 4 times and produce a "pin wheel" type pattern, shown below.

Iterations of the code using the set of numbers {50, 100, 150}. Top left - one iteration, top right - two iterations, bottom left - three iterations, bottom right - four iterations.

The numbers Thomas used (although apparently not the numbers that Liz gave) were

{7, 9, 4, 8, 5, 7, 4, 3, 9, 2, 5, 7, 3, 8, 4, 9, 7, 5, 2, 6, 3}.

Four iterations take you back to the beginning point; the four iterations are illustrated below. Once, you have made your pattern, you can colour it in and make it funky.

The four iterations of the Loop de Loop pattern, using the Donald Duck random number list.

Thomas generated his pictures using MatLab. The code is given below.

Why not produce your own Loop de Loop pattern and tweet it to us @PodcastMathsAt?