Becca's Functional Turtles

by Becca Greenstein

27 Jan 2016

Here is my rewritten flower drawing:

I figured it would be easier to keep the single (metaphorical?) seed and not plant seeds for each drawn flower, since we don’t know how many flowers there will be when the seed is planted. And the seed has to be planted before the weather can happen.

The function was helpful for the number of flowers portion. It took me a bit to get the indentation/variable names/punctuation correct. I then spent a long time orienting the flowers in the correct direction by making Tina turn and move an appropriate number of degrees and pixels.

The thing that really stumped me was where to put the functions for number of leaves and petals in relation to the if, for, elif, and except. I basically cut and pasted (logically) until it worked.

For this particular program, using functions that returned something seemed a bit superfluous. I think I would have gotten more out of this assignment if I’d started from scratch and used arithmetic in a context that actually makes sense.

Becca is a second-semester MSLS student in SILS. She likes science, words, the outdoors, and helping people. Find Becca Greenstein on Twitter, Github, and on the web.