Introduction to Computer Media

ICM Week 3: flowers

This week we learned function. The homework is to take the idea for a design and break it out into its own function. Add parameters to the function so the design can be drawn differently based on the selected parameters. Draw three or more instances of the design on the screen to show the differences possible by changing the parameters.

I built a function called flower, it has four parameters to decide the position, the height, the size, the number of petals. And when you move the mouse vertically, the center flower's size will change; when you move the mouse horizontally, the number of the petal will change from one to 60.

Here's the screen shot of my work:

屏幕快照 2014-09-23 上午8.26.57 屏幕快照 2014-09-23 上午8.27.12


here's my code: