### Contemporary Abstract Random Recursive Art ( Due 07 Mar 2014 )

Study these examples of abstract art by Piet Mondrian. You will notice that most of his abstract paintings are nested squares or rectangles. He uses primary colors like red, blue, and yellow and preponderance of white or shades of white with thick black lines.

In this assignment you will write a program that will produce images in the style of Mondrian using recursion. Study the code on Fractals to see how to draw recursive figures. Choose a drawing area of 800 pixels by 800 pixels. Prompt the user to enter the level of recursion between the bounds of 1 and 6.

• You will randomly decide to make a horizontal line or vertical line or no line. The probability of not drawing a line will be on a sliding scale. It will be almost zero for low levels of recursion and comparable to the probabilities of the other lines (horizontal or vertical) at high levels of recursion.
• Try varying the widths of the black lines. If you cannot make the lines thick enough, look upon those lines as filled black rectangles of small width.
• Position the separating (horizontal or vertical) line randomly. Play with golden ratio when you are making a cut in a rectangle.
• At the highest levels of recursion assign colors randomly. There should be a preponderance of whites or shades of white over red, blue or yellow. Experiment with other primary colors and see if you like the effect.
• Find out how to save your image in a file when you are done. You will be saving your image in a file called Mondrian.eps. The .eps stands for Encapsulated PostScript and is a graphics file format.

Your sample output session will look as follows:

```Mondrian Composition

Enter a level of recursion between 1 and 6: 4
```
Recursion level 0 is a blank canvas. Level 1 has a single line running through the canvas, dividing the canvas into two rectangles. Level 2 has three lines on the canvas, dividing it into four rectangles.

The file that you will be turning in will be called Mondrian.py. The file will have a header of the following form:

```#  File: Mondrian.py

#  Description:

#  Student's Name:

#  Student's UT EID:

#  Course Name: CS 313E

#  Unique Number: 53580

#  Date Created: