CS 151 Project 1
Skip to end of metadata
Go to start of metadata

Good evening. In this assignment, we had to define some functions to draw some interesting shapes. Then we had to make a function that drew both of our shapes in one fell SWOOP. After that, we had to add some parameters to our functions so we could have some more flexibility with our shapes (different size, side length, position, or whatever). This is my story.

Before I start, here are the tools that I used throughout this project.
In this image, you can see TextWrangler, the Terminal, and the Python window itself. A simple hexagon is drawn.

I decided to make the letter E for my first little drawing. I gave the turtle specific instructions and it carried them out with ruthless efficiency. I expected as much.

After that, I decided to make a nice little hexagon made up of 6 other hexagons. I did this by defining a function that drew one hexagon and using a 'for' loop to repeat the command 6 times.

Looks cool.

Then I got a little wild. I combined the hexagon and the E together in one function. I dubbed this "shapeC." I also imported the "random" library to use the randint function to fill my megahexagon in with random colors.

Cool.

Every time I rerun the program, it gives me different colors.



It can get a little addicting.

Then I decided to get a little more random. I made my program draw 7 of these hexagons in random positions (in a range of (-350,-200) to (350,200)) with random sizes with a random colored background. If I were a 12 year old girl, I would say "Mii program iz lykk s0oo0o randym xDD"



Baby, I like it.

In this project, I learned that the best time to work on an assignment is 30 minutes before it's due. I also learned the correct implementation of a for loop, randint, how to fill in shapes with colors, and that the computers in Lovejoy 400 don't have TextWrangler (and might not even have Python). I liked this assignment. I hope the rest of this course is as fun as this project was.

Labels