The 5-Click Snowman? Yes, Winter is coming…

Yesterday (and a little today), we completed the 5-Click House.  Now let’s do something more “interesting” like a 5-Click Snowman.

snowman

 

First, check out this quick video that demonstrates the 5-Click Snowman program.  Then we’ll break it down.

The breakdown for the drawing goes like this:

  • Click 1 sets the center of the bottom snowball (circle).  Click 2 is a point on the circle.  You can use math to determine the length of the radius (distance formula).
  • The middle snowball should then be drawn directly on top of the bottom one, with a radius that is 2/3 of the bottom radius.
  • The top snowball is now draw directly on top of the middle one, with a radius that is 2/3 of the middle radius.
  • A nose is draw in the center of the top snowball.
  • The left eye is drawn a third of the top radius over and a third of the top radius up form the nose.
  • The right eye is draw a third of the top radius over and a third of the top radius up form the nose also.
  • The mouth is a line segment with endpoint even with the eyes, located a third of the radius below the nose.
  • Click 3 determines the location of the right hand.  An arm is drawn to the middle edge of the middle snowball.  Put fingers on the hand, just for fun.
  • Click 4 determines the location of the left hand.  An arm is drawn to the middle edge of the middle snowball.  Put fingers on the hand, just for fun, also.
  • Click 5 determines the location of the top of the snowman’s hat.  Regardless of where the click is made, the hat will sit directly on the snowman’s head, centered with the nose.  The hat’s width is the same as his mouth and the brim is a small rectangle with a length the same as the bottom snowball’s radius.

This may all seem a bit confusing.  Take is slow.  Begin with a diagram.  I’ve provided a sketch to help you design your diagram.  It will take a little math to get this right, but it’s not anything you can’t handle.  Just Cartesian coordinate stuff.  Check out the sketch with this link.

After you have your plan drawn out, start with just getting the bottom snowball drawn.  Next, move to the middle snowball. Don’t be in a hurry to finish.  You may just wind up getting frustrated.

Save your program with the file name yourname-five-click-snowman.py.  Make sure you also put comments at the beginning of your code with your name, the program name, and the date.  Use this submission link to submit your work.  Submit at the end of class, regardless of whether your are done or not.

Let it snow!