On this page:
1 Before You Proceed
2 Task
3 Example
4 Precision
5 Handing In

Flags

The world is full of countries, each with its own unique identifier, in the form of a beautiful flag. Your job is to create the flags of the following countries by composing shapes onto a scene.

1 Before You Proceed

Please be sure to look up How to Contact Us.

We encourage you to read the Pyret language tour, using the documentation for Pyret as needed. You will be writing your code online.

To begin, please go to code.pyret.org and follow the instructions to connect your Brown Google drive.

When you are done, save a copy to your Google Drive with an appropriate title. Please be sure to use your Brown Google account (one that ends in brown.edu), not any other (e.g., one that ends in gmail.com).

2 Task

Create flags of the following countries:
  • Vietnam

  • Chile

  • Suriname

  • Tunisia

  • Saint Lucia

3 Example

Japan!

include image

 

place-image(

  circle(35, "solid", "red"),

  100,

  50,

  rectangle(200, 100, "solid", "white"))

image

Note: The black bounding box is shown only to delimit the image from the rest of the page. It is not being generated by the code above!

You can use either place-image or overlay (or any of their variations) to position your images. Pick whichever is easier. They each have their strengths and weaknesses. You can read more about Pyret’s image library support in the language documentation.

4 Precision

We are not looking for an exact match. We’re going to grade it by eyeballing. Therefore, we aren’t specifying exact dimensions or ratios to follow (though you are welcome to geek out by checking out the precise ratios and colors and so on, and matching them). The goals of this assignment are:
  • to get you on a schedule of doing supplemental homework

  • to learn that you can very easily create images, and do fun things with surprisingly little

  • to understand that Pyret treats images as valuesNote that Racket also treats images as values. The Pyret image library is actually based on that of Racket. just like it does numbers, strings, lists, and other things you will learn about this semester

An explicit un-goal is to create something that would pass muster with the United Nations. They probably have enough flags in stock already.

5 Handing In

To submit this and all future homeworks, please go to Captain Teach (you should consider bookmarking this URL) and use your brown.edu email address as your username. We have the addresses of everyone who registered for CSCI 0170, so if you had registered, you should be known to the system. If you have trouble logging in, let us know on Piazza. Similarly, let us know if you have trouble with the handin instructions.

Note that you should not use the same facility that you use for turning in CSCI 0170 homeworks.