Tutorial/Flags

From Progzoo
Jump to: navigation, search

In these exercises you draw the flags of various countries using graphics commands.

The rectangles tutorial has you drawing the flags of Libya, France, Germany and Palau. You can draw these flags using only rectangles of different colors. These exercise get you used to some graphics commands. You might need to be reminded of x,y coordinates.
tut1page2.png
[[The polygons tutorial includes flags made with triangles and other polygons. The flags of Napier University, Jamaica and the Bahamas can be drawn with triangles, the Seychelles require triangles and a quadrilateral.

|The lines tutorial includes flags that require lines. By changing the color and the thickness of the lines drawn you can produce the flags of England, Scotland, Botswana and Trinidad and Tobago.

]]
File:3) Polygons
tut1page3.png
4) Stars

[[Image:The stars tutorial includes flags that feature the pentangle - a five pointed star. In each example the star has already been defined as a polygon - all you have to do is to translate and scale the star to produce the flags of Vietnam, Panama, Bosina Herzeginia and Zaire. |thumb|left|5) Repeat]]The repeats tutorial focuses on flags that include repetition. You can use loops, such as for to perform the same action over and over. This is how to draw the flag of Bahrain or Qatar, also India, Namibia and the European Union.

[[{{{19}}}|6) Hard]]
The harder tutorials includes flags that include repetition that can be exploited. Your aim in tackling these problems is to produce short code that makes the most of the repetition. Ideally you will be defining your own methods or subroutines.
{{{20}}}
[[{{{24}}}|{{{21}}}]]

[[Image:{{{22}}}|thumb|left|{{{23}}}]]{{{25}}}

[[{{{29}}}|{{{26}}}]]

[[Image:{{{27}}}|thumb|left|{{{28}}}]]{{{30}}}

See also SVG:Tutorial