15-112 Spring 2015 Homework 5
Due Sunday, 15-Feb, at 10pm

Read these instructions first!
  1. s15 Quiz4 Animation [10 pts, manually graded]
    First, carefully watch the video solutions for the animation problem in s15 (this semester's) quiz4, as explained in the s15-quiz4-solutions videos.

    Be sure to carefully watch these videos in their entirety, and be sure you understand each step of the solution. Then, duplicate the solution (just to the animation problem) in your hw5.py file (below the #ignore_rest line, of course). Do not turn this into merely a typing exercise, but rather be sure you understand every step of the solution. That said, of course, we would expect everyone to have very similar or nearly identical solutions just to this specific problem.

  2. f14 Quiz 5 [10 pts, manually graded]
    In a triple-quoted string at the top of your hw file, include the solutions to f14's quiz5 (except for the bonus, which you should skip (or do for fun if you wish)).
  1. Bonus/Optional: infiniteZoomAnimation [2.5 pts, manually graded]
    Write the function infiniteZoomAnimation(), taking no parameters, that when called displays a step animation that matches this video. Your animation should dynamically generate (visually-pleasing) colors so that they never repeat (beyond chance).

  2. Bonus/Optional: wordCloudAnimation [2.5 pts, manually graded]
    Given a list of words, you could create a static word cloud by laying them out in a non-overlapping way, using a variety of text sizes and colors, such as in these images. For this problem, given the limitations of Tkinter, you may restrict these layouts to strictly horizontal text, as in this image or this one. Actually, while not required, it would be easy to also have vertical text where the letters are oriented horizontally (just draw the text one letter at a time).

    These are static word clouds. You could also make them dynamic, in an animation that shows the word cloud being constructed and deconstructed, such as in this video (though it uses non-horizontal text, which you would not).

    With this in mind, write the function wordCloudAnimation(words) that takes a list of words and displays a step animation that animates the construction and deconstruction of a word cloud composed of the given words, as in the video above. Your animation may repeat with the same word cloud (though it would be even nicer if it generated new word clouds each time!). Also, just for this problem, you may use 2d lists if you know how to do so and think they would help (though you do not necessarily need them and may ignore this option). Finally, as a hint, you will probably want to compute the word cloud layout first, then pass that information somehow into the animation (rather than have the animation repeat the world cloud layout computation on every step). Good luck, and have fun!