Drawing flags and patterns

This project will bring together everything you've done so far. You will be drawing, getting user input, using loops and if statements, and writing methods. Download the flags and patterns base project and import it into Eclipse, and then modify the FlagDrawer.java and PatternDrawer.java files to complete the parts of the assignment.

Part 1: Tricolour Flag Drawer

Earlier we created lollipop shapes using the UI.draw* methods. In this assignment you will create a specialised flag drawer that allows you to easily generate flags that consist of three equal-size stripes (e: France, Italy, Russia, Germany, etc).

Core

Completion

Challenge

No challenge — move on to the patterns.

Gallery of triband flags

Part 2: Repetitive Patterns

There are many patterns made of repetitive elements used in a wide variety of applications, ranging from board games to vinyl floor coverings. Complete the methods in the PatternDrawer class for drawing a range of these patterns. Each method requires using loops. The position and size of the pattern are specified by the three constants boardLeft, boardTop, and boardSize. Each method starts by asking the user for the size - the number of squares along the edge of the pattern. The loops should use this number!

Core

Completion

Challenge