Problem Set 2 - Due Tue, Sep 18 at 23:59

Reading and helpful Information

  1. The CS111 Problem Set Guide gives an overview of psets, including a detailed description of individual and partner tasks
  2. Goldwasser & Letscher, Chapter 3, sections 3.3-3.6, pages 103-110.
  3. Slides and notebooks from Lec 3.
  4. Problems and solutions from Lab 2.
  5. Our CS 111 Code Style Guide

About this Problem Set

  1. Students with last names from M to Z are expected to make use of the CS 111 Google Group this week to either ask a question or answer one.

  2. Task 1 is an individual problem in which you will get practice with debugging in the context of fixing a misbehaving graphics program.

  3. Task 2 is a task that explores abstraction in the context of cs1graphics transformations and layers. In this problem, having a partner is optional. If you want to have a partner, use this shared Google Doc to find a pair programming partner and record who your pair partner is. Please do not use cs111-fall18 to find partners.

  4. Collaboration and honor code: you can talk with other individuals and teams about high-level problem-solving strategies, but you cannot share any code with them.

  5. The CS111 Problem Set Guide gives an overview of psets, including a detailed description of individual and partner tasks.

  6. Follow the practices discussed in our CS111 Code Style Guide.

  7. In Spring 2018, students spent UPDATE TIME NUMBERS HERE

All code for this assignment is available in the ps02 folder in the cs111/download directory within your cs server account.

Task 1: Debugging Graphics

This is an individual problem which you must complete on your own, though you may ask for help from the CS111 staff.

As part of experimenting with layers and transformations in cs1graphics, Lois Reasoner wishes to create the following picture, which contains 4 transformed versions of a face:

Relative to the upper left face:

Lois writes a program in an attempt to create the above picture. Click here for Lois's program, a copy of which can be found in the ps02 folder as Although it is structured well and in many ways is close to correct, Lois's program generates the following incorrect picture due to numerous bugs:

Your goal in this subtask is to fix Lois's program so that it generates the correct picture. In the ps02 folder is a file that is initially a copy of Lois's buggy program with some extra header information at the top that you should fill out and an extra triple-quoted comment section at the bottom (more on this below). You should modify by finding and fixing all the bugs it contains, so that it ultimately generates the correct picture.


Task 2: Bunny Money Pattern

This task is required but you have the option to work with a partner on it if you wish. We strongly encourage you to work in pairs on this problem. Use this shared Google Doc to find a pair programming partner and record pair programming partnership.

Your goal in this task is to generate the following picture by fleshing out the file in the ps02 folder:

There is a lot of stuff going on in this picture. You can see that one pattern is repeated, at different sizes and rotations. Let's call this pattern bunnyMoney, as shown below (enlarged):

The file begins by importing the following shapes to get you started; the rest you will create using cs1graphics.

Two graphics that are provided for you:

Description Graphic
(imported as a Layer from
with the reference point marked in orange
(imported as a Polygon from
shown with an orange fillColor

In general, we recommend that you start with pencil and paper (as opposed to jumping into Canopy). You want to build your code incrementally, making sure that smaller parts work before attempting the entire picture.

Useful bunnyMoney information:

  1. The large green (lightgreen) rectangle has a width of 600 and height of 300
  2. The blue (navy) circle in the center of the bunnyMoney has a radius of 75
  3. Each of the small wedges + bunny on the navy circle are one-quarter the size of the original wedge + bunny
  4. The grey (darkgrey) rectangle has a width of 330 and height of 70
  5. This set of slides give a high-level overview of how to make bunny money.
  6. Here is bunnyMoney shown with a gridlines spaced 50 apart and also with gridlines spaced 25 apart (use the grids to figure out where to place things):

Bunny Money Mosaic information that will be useful for you:

  1. The pink canvas has dimensions 900x600
  2. The 900x600 bunny money mosaic with grid is shown here:
  3. Note that the ears of the bunny are always outlined in white; sometimes the bunny is scaled smaller and the ears may appear to be non-white, but rest assured they retain their original color.


Task 3: Fancy Bunny Money [THIS IS AN OPTIONAL TASK]

If you had fun making bunny money and have time to spare, then you can complete this OPTIONAL task. In this OPTIONAL task, the goal is to create this picture in the file

The image is very similar to the one in Task 2 above, but has a line of bunnies in the grey rectangle.

Useful fancy bunny money tips:

  1. Here is an enlarged view of fancy bunny money with a grid (each grid line is 50 units apart):
  2. The smaller bunnies are 30% the size of the original bunny; the larger bunnies are 42% the original size.
  3. Here is an enlarged closeup of the line of bunnies with a grid (each grid line is 10 units apart):
    This gives information about where to place each bunny.

Task 4: Honor Code Form

The ps01 folder contains a file with several variable assignments for your name, the time you spent on the tasks, etc. Change the values in these variable assignments to appropriate values.

How to turn in this Problem Set

Softcopy (electronic) submission:

Hardcopy (paper) submission

There is no hardcopy submission. Problem set submission is entirely electronic.