Assignment 1: Flags
Assigned: Thursday, 9 September
Due: Thursday, 16 September, 11:59 p.m.
- Navigate Pyret documentation
- Use the
Open code.pyret.org and ensure it's connected to your Google account.
Make a new file named
Note: Assignments will be graded anonymously, so don't include your name with your program.
You'll want to consult the Pyret documentation. It's accessible from CPO by clicking on the pirate button in the top left corner.
In particular, we recommend taking a look at the image documentation before working on this assignment!
If you have any questions, please post on Campuswire. Don't post any code unless requested by the coaches or instructors, though.
Your friendly coaches and instructors are also here to help with this assignment one-on-one, in person and on Zoom. Check your section's website for a schedule of office hours.
Write code to generate four flags:
Set up your code so that the four flags are output in the interactions window (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
We do not care about
- exact positioning,
- exact size ratios,
- 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 some of these flags. If you want to be
accurate, a comprehensive list of the color names Pyret understands can be
For this assignment, we won't be grading on style. However, you should start familiarizing yourself with good Pyret style, which will be graded on future assignments.
Download your file (File → Download) and ensure it's named
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.
This assignment is adapted from Kathi Fisler and colleagues at Brown University.