Project 3

Writeup:

For this lab we were asked to create three functions that made three simple shapes. We then had to make a conditional loop that generated each shape as a result of random numbers, and a third function that moved the position of the turtle horizontaly each time through the loop to create a linear progression of those shapes. In order to create a grid of images rather than just a line, we had to design a loop that moved the turtle both horizontally and verticaly in specified increments.

I designed the grid drawing algorithm to go through every character in my string using a conditional loop that would reposition the turtle along the x-axis nine times out of ten. On the tenth time, the turtle would reposition itself back to its original x-axis value and down an increment for the y-axis value. If successful, this loop would repeat the same function that created my linear progression of shapes moving continuously down on y-axis.

By using the modulo operator, dividing the first argument (i) into the second (10), each time the remainder was not 9 as 'i' increased, the turtle position would move horizontaly by a multiple the increment, which I set at 25. When the remainder did equal 9, the turtle was instructed to move back to the original x-value and down by two times the increment.

Extensions: I added my partners 'triangle' shape to my drawShape function and used the random() and width() operators to generate colors and different thicknesses for my shapes, respectively.

Linear:

Grid:

Mixed shapes with my partner: