Coding Challenge: The Recursive Snowflake

The Challenge

Write a program, that for a parameter n=1 creates a basic shape out of four straight lines:

n=1

When you increase n, each line gets replaced by a smaller version of the basic shape. For, instance with n=2 you get:

n=2

And with n=5:

n=5

When your program is able to produce a picture for 0 < n < 6, you have mastered this challenge.

What you can exercise in this coding challenge:

  • Recursive algorithms
  • The Pillow library in Python
  • The turtle module in Python