Flags
Released | Due |
---|---|
TBD | TBD |
Homework 1: Flags
Goals
- Getting used to the pyret environment
- Creating flags and other symbols from basic shapes
- Practicing program planning
Setup
- Go to code.pyret.org; this requires logging in with any Google account.
- Make a new file in code.pyret.org called hw1-code.arr.
Resources
Documentation
The Pyret documentation is accessible from the Pirate button in the top left corner of code.pyret.org.
For this assignment, you will find the image documentation useful. We recommend skimming through the page before starting the problems!
Staff Assistance
Your friendly Professor and TAs are here to help with this assignment! You can find our schedule for office hours on the course webpage.
What we will look for when grading
- We want accuracy in the shapes that are present, their general locations, sizes, and orientations.
- We do not care about exact positioning, size ratios, borders, or angles.
- We do not care about specific color shades. For example, you can use “green” even though it produces a much brighter green than on some of these flags. If you want - to be accurate, a comprehensive list of color names can be found here.
- We will not be grading for style on this assignment. (In fact, most of the style guide won’t even make sense until the middle of next week.)
Learning Goals:
- Navigate Pyret documentation
- Work with Pyret image operators to compose expressions
- Practice program planning
Part One: Generating Flags
It’s been discovered that the files for a few flags have gone missing, and you have been tasked with recreating them! The flags you will need to recreate are as follows:
- Lithuania
- Greenland
- Tunisia
- Saint Lucia
Some things to note:
- The entire flag should be filled with color (white space on a flag should be white, not transparent!)
- The flag does not need to match exactly, but key elements or features should be present
Part Two: Program Planning
Most of the time, producing successful code requires thorough outlining and planning. Program planning is a skill that can help you deconstruct a problem in a way that allows you to avoid potential bugs. We now want to practice the process of outlining code prior to coding.
Task 1: Without coding it, write a list of steps and action items that describe, in words, how you might create the Maryland Flag (this might be tricky! Think about the order in which you would have to layer your shapes in order to get the correct colors in the right places). Use any terms you want to describe the steps: you don’t have to stick to names of operations that exist in Pyret or concepts that we’ve covered in class.
Write your instructions in a word processor or text editor of your choice (Word, Google Docs, etc), then save/export the file as a PDF (we’re practicing this workflow now since we will need to do this multiple times this semester). Remember you’re writing these steps in prose, not code.