Bowen's CS151 Project 2
Skip to end of metadata
Go to start of metadata

The key purpose of this assignment was to further familiarize ourselves with the turtle package and try to use some more complicated things within it.  I learned how to make more streamlined code by using "turtle.(blah)" instead of importing the entire turtle package with (import turtle *). We also worked more on making functions, or packages of code that can be called on later and multiple times and can contain parameters that can be used, for instance, with a shape to call it in different sizes/locations/etc.

Our first portion of the project was to set up a shape folder (python file) where we could safely construct and compile a bunch of different shapes so that they didn't make our main file messy.

Here are all the shapes that I started with...

I then used them to concoct these bad boys...

the coral

some seaweed (inspired more by kelp forests, i've been watching a lot of planet earth)

and then to round my undersea-scape off I needed to add some fish...

... even if they do have pentagram eyes.

I was then finally able to construct my underwater masterpiece, I put all of my complex shapes into a function in my file and then called them in locations I mapped on a scrap piece of paper to try and achieve some form of symmetry with the scenery and natural layout of the fish. Ended up looking like this.

As an extension, I added color to each of the different aggregate shapes as well as figured out a fill scheme for my scene using turtle commands (making sure to be careful to fill the scene first and not "blue over" the rest of the drawings). Coming up with...

For my second scene I chose to try and model some buildings in Chicago as that is where I am from. Using the same steps as above, I was able to come up with three different buildings and then another that is supposed to look like the Sears Tower.  Within the code I tried to add in what one of the extensions was asking for by using for loops and the random module.  I had never used either of these before and it took a little bit of time to figure out but once I realized that the random functions can be used as x/y and scale values everything seemed to work out. Using the for loops helped to make sure I didn't have to write as much code either. The final scene looked like this (the one time I ran it since it will look differently every other time)...

I also used a python function that I did not know before in that I learned how to change the title of the turtle window by using the code 

wn = turtle.Screen()

wn.title("Hello Grader!")

which yielded...   

So there should be a little greeting for you when you run my chicago and undersea scenes.

During this project I learned how to better streamline my code "flow" as well as add helpful messages within my code using triple quotation marks.  I also learned how to use the random module and basic for loops.

I did not work with anybody on this project and only consulted Professor Taylor with help debugging a tabbing issue.