Deborah R. Fowler
Algorithms and
Process
Posted on Aug 29 2018Updated Sept 20 2020
Updated April 2 2023 to note done and exitonclick functions
Updated April 3 2023 explicit instructions for Snowfamily (practice exercises will all follow similar guidelines, formal exercises the formal naming convention)
Updated April 15 2024
- programming process
- algorithms - clear plan
- code habits - best practices
Here is a video describing algorithms https://www.youtube.com/watch?v=kM9ASKAni_s
Reminder to keep your file tidy - take advantage of looping and functions! Comment your code!
Snowman are due today. Next step is to build a snow family. See the homework description below.
Note that you can set up a window
turtle.setup(400,400)
You can hide your turtle
turtle.ht()
You can also use setpos but be careful as this needs to have arguments to make it properly scalable
turtle.setpos(0,-250)
HINT: add paramaters xpos, ypos to move position ie. turtle.setpos(0 + xpos, -250 + ypos)
HINT: add a parameter scalefactor to your circle radius and forward commands ie) turtle.forward(100 * scalefactor)
And if you are making an assumption about offsetting by a value you may need to use setpos(0 + xpos, -250 * scalefactor + ypos)
Additional note - IDLE keeps your turtle window open, however other IDEs or running command line will draw and close. To keep the window open use turtle commands done() or exitonclick()
HOMEWORK
Next steps:
1. Create a snowman function that takes size or scale as a parameter so you are able to draw your snowman different sizes
2. Add the ability to draw the snowman in a position, given x and y as parameters to your function above
3. Create a snowman family
See below for how to hand in your work and hints
Dropbox.com is where you will hand in your files. For Dailies
exercises they will be contained in a Dailies folder you create
and will follow the naming convention of FirstnameTopic. So for
your snowfamily:
Please place your python file into dropbox.com in your
Dailies folder where you put your FirstnameInitials.py and FirstnameSnowman
folder
Inside Dailies create a folder and name it FirstnameSnowfamily. In that folder will be:
- FirstnameSnowfamily.py
- FirstnameSnowfamily.jpg (or png) which is simply a screen snap of your snowfamily
Dailies exercises are working toward gaining the skills needed for the more formal exercises, 1-4 and those will follow the submission guidelines as specified on the exercise handout.
You have the information to start on the quilting exercise, however completing the snowman family will ensure things go smoothly with the exercise.
Have your snowman family ready no later than Class 4. If you want to set your screen size, see above or the examples in Class 02, bottom of the page.
If you are stuck, this video specific to the snowman may be helpful on vimeo and on youtube:
Below are examples from previous quarters.
S20 - Amanda, Deanna, Elizabeth, Michele, Kayla, Alexis, Riley, Kaitlyn, Justin, Brittany