### Cantor Dust

Cantor dust is a fractal composition of squares,
where each square is recursively subdivided
into a three-by-three grid containing four squares in its corners.

Cantor dust is a recursive construction.
At the base case of the recursion, we want to draw a square.

**Complete** the implementation of the `square`

function to draw a square with a given `side`

length and `color`

. Use PyTamaro's rectangle function for this.

If you already have a `square`

function in your toolbox, feel free to instead `from toolbox import square`

.

Let's create a function that can compose a list of lists of graphics into a two-dimensional matrix.
The outer list represents the rows, the inner lists represent the cells in each row.

Using that function, let's create the following graphic:

**Complete** the implementation of the `compose_matrix`

function.

Now let's implement the recursive `cantor_dust`

function.
It takes two parameters:
the `side`

length of the Cantor dust to be drawn,
and the `iterations`

to denote the depth of the recursion.

Here is the result of `cantor_dust(256, 3)`

:

Each recursive function invocation
composes four smaller Cantor dust graphics into a bigger Cantor dust graphic;
the base case (`iterations == 0`

) just draws a square.

**Complete** the implementation of `cantor_dust`

.

Let's visualize the evolution from a normal square to Cantor dust with growing recursion depths (larger and larger `iteration`

counts).

**Complete** the implementation of the function `evolving_cantor_dust`

that places evolving Cantor dust graphics beside each other, possibly with gaps in-between.

Cantor dust is related to other fractals. Feel free to explore them. Here are some ideas:

Instead of keeping the four corners of the three-by-three grid, you also could keep other grid cells.
For example, you could generate a SierpiĹski carpet (similar to the SierpiĹski triangle), by removing only the middle cell of the three-by-three grid.

The Cantor dust we produced here is a two-dimensional variant of the Cantor set.
You could visualize a one-dimensional Cantor set,
and you could visualize the evolution of the one-dimensional Cantor set
by placing Cantor sets with gradually larger iteration counts above each other.

In this activity you learned about a fractal named "Cantor dust".
To compose that fractal, you used a **recursive function** (`cantor_dust`

, which calls itself).
To terminate the recursion you used an **if-statement**,
and to compose the three-by-three matrix, you practiced **nested for-loops**.