Fun with Flags – Part 2: more flags

Flag of MadagascarStep 5 – A problem with white flags

Let's draw the Madagascan flag.

You can use exactly the same method as for the flag of Benin, just changing the colours:

Use your code from step 4 to draw the flag and see what happen...

Madagascar is a large island off the south-east coast of Africa. It's in the Indian ocean and is most famous for being where lemurs come from. It's where the animals end up in the first Madagascar film.

A problem to be solved:

The problem is that the white bar doesn't show up on the background. It just looks like there's a red and green flag.

We can solve this problem.

  1. We want the three blocks to work like they already do, but we need to add an outline to the white section
  2. Add this code to the end of your flag code – make sure it goes after the last end_fill() command:
    color("black")
    right(90)
    forward(60)
    right(90)
    forward(120)
    right(90)
    forward(60)
  3. Run your code to see how it works

    This should add a black line around the outside of the white block

  4. Depending on how exactly what you did with your code for the flag of Benin you might need to change some of the numbers in my suggested code

Putting an outline around part of anything white is a good solution to the problem of white backgrounds. You could have used this method in Part 1 – Step 8 when you were drawing the flags of countries such as Poland. You'd certainly need a black outline for a flag like the flag of Japan.