CSC 100: The Beauty and Joy of Computing

A printable PDF is available.

Homework 1 - Due Monday, September 18

This is an open-ended assignment, where you have a lot of flexibility to demonstrate some creativity. You will create your own pen/turtle drawing blocks in Snap!, and use them to draw a cool picture. What is the picture? You decide! The artistic product isn't what is really important here -- what is important is your use of abstraction in creating your own blocks to draw the picture. Here are the requirements:

  • You must create at least three new custom blocks, each of which draws something -- these must be new, and should not repeat the drawing blocks you created in labs.
  • At least one of your blocks must be used in the code that defines another one of your blocks! In other words, one object that you are drawing must contain multiple other objects that are drawn by a custom block.
  • You must utilize color, and your picture can't be monochromatic (one color).
  • You should use different pen sizes to draw different width lines.
  • Your final drawing should include at least 8 different top-level objects.
To get you thinking about this, here are two examples. You could draw a field of at least eight flowers of different colors, where each flower is drawn by a custom block, which uses another custom block to draw leaves on the stem or petals. Or you could draw a village made up of many houses, where your block that draws a house uses other blocks you create to draw doors or windows.

I'm sure you can come up with other ideas that fit the criteria above!

For the final five points: If you want a chance at making a 100 on this assignment, your drawing blocks must be scalable, and your final drawing should use different sizes to give some sense of perspective (objects further away are drawn at a smaller scale). To do this, each drawing block should take a "percent size" parameter, where percentages greater than 100 produce larger pictures, and percentages less than 100 produce smaller pictures. If you think about drawing a leaf, your code would then adjust the amount of distance it moves on each step based on this percentage. This is actually a little trickier than you would suspect at first, so do this part after you have a good solution to the basic drawing problem. Save your original solution, and work on this using a different filename, so you don't accidentally destroy your original solution!