Assignment 1: Fun with Flags

Assigned: Thursday, 1 September
Due: Wednesday, 7 September, 11:59 p.m.

  • Navigate Pyret documentation
  • Work with Pyret image operators to compose expressions
  1. Open code.pyret.org (CPO) and ensure it’s connected to your vassar.edu Google account.

  2. Make a new file named asmt01.arr.

Note: We’ll grade the assignments anonymously, so please don’t include your name anywhere.

  • This guide will help you get started with Pyret!

  • You’ll want to consult the Pyret documentation. It’s accessible from CPO by clicking on the pirate button. (That’s Bonny, named after pirate Anne Bonny.)

    In particular, we recommend at least quickly browsing through the image documentation before you start working on this assignment!

  • Your friendly coaches and instructors are also here to help with this assignment one-on-one. Check the schedule of student coaching hours and your instructor’s office hours.

Write code to generate these three flags:

  1. Switzerland

    Flag of Switzerland

  2. The Republic of the Congo

    Flag of the Republic of the Congo

  3. Panama

    Flag of Panama

Set up your code so that the three flags are output in the interactions pane (on the right) when we press the Run button. Make sure nothing else is output (no sub-images, numbers, strings, or otherwise).

When we grade the assignments, we will be looking for accuracy in

  • the shapes that are present,
  • their general locations,
  • sizes, and
  • orientations.

We do not care about

  • exact positioning,
  • exact size ratios,
  • borders,
  • exact angles, or
  • precise color shades.

For instance, you can use "green" as the color name even though it produces a brighter green than on these flags. If you want to be more accurate, a comprehensive list of the color names Pyret understands can be found here.

For this assignment, we won’t be grading on style (but we will on future assignments!)

  1. Download your file (FileDownload) and ensure it’s named asmt01.arr.

  2. Upload your assignment on Gradescope.

Note: You can submit as many times as you want before the deadline. Only your latest submission will be graded.

The following won't be graded, but if you want to test your flag-making abilities, we recommend trying:

  1. Jamaica

    Flag of Jamaica

  2. Greenland

    Flag of Greenland

These are more challenging than they look!

This assignment is adapted from Kathi Fisler and colleagues at Brown University.