Lab 6
Due: Friday, Mar. 24 at 11:59pm on Moodle
For this lab, first find your randomly assigned partner. Introduce yourselves - the person with the first name that comes first alphabetically should begin as the "driver", with the other partner as the "navigator". The driver will have the code open, and the navigator will have these instructions open.
At the end of the lab, email the code (finished or not) and transcript to the person who started as the navigator. If you do not finish during lab you have two options:
(1) Arrange to meet before Friday and finish the lab together.
(2) Continue the code separately and denote the part you did on your own with a comment.
Note: it is not an option for one person to complete the code on their own and then send the finished code to their partner to submit. Any code that you submit should be either written by you, or written by you and your partner while you were pair programming. Both partners should submit their code on Moodle.
These paintings are said to evoke different moods and reactions depending on the pattern of the chosen colors. In this lab you'll get a chance to choose your own color scheme.
First create a new file called lab6A.py and make sure it is in the same folder as graphics.py. You are welcome to start from the starter code in graphics.py as we have done in class. The next steps will walk you through the process of creating a spot painting.
After you have defined these two variables, use them to define the width and height of the window such that the spacing between circles is equal to the diameter of each circle. The spacing at the edges of the window does not need to be anything in particular, but here it is equal to the radius. At the end of this step you should be able to get something like this:
Here is another example:
Here is a converter that can help you develop intuition about how modifying the RGB components will affect the color: Color to RGB. After you've completed this function, call it inside your for loop to determine the color for each dot. Change both the fill color and the outline color to the randomly generated color. Below are a few examples with different color palettes:
Completely random colors:
Red color palette:
Blue/green color palette:
Create a new file called lab6B.py, and you may start in the same way as Part A. In this section of the lab we'll again reproduce an artistic work, this time by Sol LeWitt, whose work is currently displayed at MASS MoCA. Here we will reproduce the left-hand side of the following work:
I used a line width of 2, but feel free to modify this, or change the color of the background or the lines.
Here the line separation is constant, but the number of lines changes depending on the window size.
In addition to the square from Part B, also complete the circle on the right to reproduce the entire drawing shown above. Another option:
Here are a few other Sol LeWitt paintings to reproduce / modify if you are interested. Feel free to use these as inspiration to create your own geometric painting. If you complete either of these extensions, email me your work and I will show it in class.
You do not have to submit a transcript for this lab. Make sure that both you and your partner have a copy of all the code written during the lab period, and the screenshots. Both partners should submit the files: