Flags
1 Task
2 Example
3 Precision
4 Language
5 Image Teachpack
6 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 Task

Create flags of the following countries:
  • Vietnam

  • Chile

  • Suriname

  • Tunisia

  • Saint Lucia

2 Example

Japan!

(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, such as overlay/align) to position your images. Pick whichever is easier. They each have their strengths and weaknesses.

3 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 Racket treats images as values 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.

4 Language

Make sure you’re in the Beginning Student language. To change it, go to the Language menu and select Choose Language... .

5 Image Teachpack

In order to use the functions place-image, rotate, and other goodies, please use the 2htdp/image.rkt Teachpack:
  • If you have installed a cs017 Teachpack, you will want to disable it; therefore, remove it from your list of Teachpacks (Language menu, Clear All Teachpacks).

  • Go to the Language menu, select Add Teachpack..., and choose 2htdp/image.rkt from the middle column.

You will likely find the documentation useful.

6 Handing In

Using the file navigator, go to your cs019 directory within your home directory. (If it doesn’t exist, create it using the Unix command mkdir.) In it, make a new directory called flags (again, using mkdir). Put your solution, which should be named flags.rkt, inside that directory. Open the terminal and paste the following two commands (on separate lines, press enter after each):

cd ~/course/cs019/flags

cs019_supp_handin flags

Note that you may use a different command than used for CSCI 0170, because the homeworks are being graded by different people.