# Pages CS 151 Computational Thinking Fall 2012 Will Pepi Project 2 Write Up

For this assignment, I first created a library of shapes with variable location and size values, so that I could call on them to create two scenes from a Maine coastline. I first created two simple shapes and made sure they were drawn correctly no matter what location, orientation, or size values I assigned them. I then created a sailboat shape and a shell shape to actually use in my scenes. For my scenes, I first created a simple, colorless ocean with a boat on the surface, and shells on the sea floor. For my second scene, I introduced both color and waves.

The name of the file with all of my shapes is called "shapelib" so for task one I just wrote " import shapelib" in addition to "import turtle" at the top of a separate file called "Main" so that I could call functions from shapelib at any point in my main file. I then made a function called "coast1" in my main file and called some of the shapes from my shapelib to make sure it worked.

For task 2, I created a triangle and a hexagon in my shapelib. They used a "goto" function from my shapelib which made the location at which the shapes were drawn variable. Instead of actual distance values, I used the variable "length" so that the size of the shapes is also variable. In the function definitions, this looked like "def triangle( x, y, length):"

For task 3 I created two new, more complicated shapes that would ultimately be used in my Maine coastline scenes. For the sailboat I used the parameters: x, y and scale. I used the triangle function I defined earlier as the sail, and because the triangle function already had parameters, I had to call it this way" triangle( x-65*scale, y-100*scale, 125*scale ) so that the triangle would draw correctly for different boat scales. Otherwise, the code for the boat used only turtle functions and a "goto" function. For the shell, I essentially drew a rectangle from the same starting point over and over again, rotating it by a degree of 10 each time so that the spiral shell shape resulted.