Ruby:Flags Tutorial

From Progzoo
Jump to navigation Jump to search
If Tutorial >> | Quick Quiz

In these exercises you draw the flags of various countries using graphics commands. You make use of the Graphics2D class to complete these.

Flags with Rectangles
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 introduce the basic graphics commands.
Flags with Lines
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.
Flags with Polygons
The polygons tutorial includes flags made with triangles and other polygons. The flags of Napier University, Jamaica and the Bahamas and the Seychelles require triangles and quadrilaterals.
Flags with Stars
The stars tutorial includes flags that feature five pointed stars. In each example the star has already been defined as a polygon. You have to translate and scale the star to show Vietnam, Panama, Bosina Herzeginia and Zaire.
Flags that Repeat
The repeats tutorial focuses on flags that include repetition. You can use loops, such as for to perform the same action many times. Draw the flag of Bahrain, Qatar, India, Namibia and the European Union.
Difficult Flags
The harder tutorials includes flags where the repetition is harder to exploited. To do this well you will use methods and parameters.

See also SVG:Tutorial