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
Vietnam
Chile
Suriname
Tunisia
Saint Lucia
3 Example
Japan!
include image |
|
place-image( |
circle(35, "solid", "red"), |
100, |
50, |
rectangle(200, 100, "solid", "white")) |
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
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
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.