CSCI0050 Flags Assignment
CSCI0050 Homework: Warming up with Programming

Due: Wednesday, June 26 at 6pm (submit through Canvas)

Assignment Goals:
  • To make sure you can write, run, and submit Pyret programs.

  • To give you practice writing code and breaking down problems into the collection of operations that Pyret provides.

  • To give you practice working with Pyret’s documentation.

Collaboration Policy: Collaborating with others on this assignment is fine. However, we strongly recommend that you type these out on your own and try doing at least a couple of them on your own. This assignment is building up core skills that you’ll need throughout the course.


Write Pyret programs to generate images of the following four national flags (you can find the flags online):

Set up your file so that when it is run, the four flags appear in the interactions window.

Tips and Hints

There are many more operators on images than what we have covered in class. To see the full list, go to the Pyret documentation. Under the "Builtins and Libraries" link on the left sidebar, look for the "image" library. That will give you a list of all the image operations. The list clusters operations by roughly what they do. So if you are looking for different ways to align images, look for an operation you know (like "overlay"), then see what other operations are nearby on the list.

Frequent or Anticipated Questions

This is mostly a warmup assignment, to make sure everyone can get Pyret running and write some basic programs. We will visually inspect your flags to make sure they look roughly accurate (see anticipated question), and eyeball your code to look for areas in which to give you feedback. This assignment will not weigh heavily in final course grades.

What/how to turn in

Make sure you have included a collaboration statement as a comment at the top of your file. This statement should look something like:

# I have done this entire assignment on my own


# For the turkish flag, Jaime and I developed the code together

When you are done, download your file from Pyret (under the "More" menu), save it with the name flags.arr, and upload your file to the homework submission area for this assignment in Canvas.