Fun with Flags – Part 3: flag mania

Step 1 – Flags with circles

The flag of Bangladesh has a circle on it.

So far we've only attempted rectangular type shapes and the odd triangle. But we can do circles as well.

Bangladesh is a country in south Asia. It borders India and has a coastline on the Bay of Bengal. It's capital city is Dhaka.

Flag of BangladeshDrawing the flag of Bangladesh

This is a bit of a challenge. There's a solution after the instructions, but try it yourself first.

The flag needs to be a bit wider than our usual flag. In this case, the flag is 200 steps wide and 120 steps tall, so we can start by drawing that.

  1. Draw a flag 200 steps wide and 120 steps tall. Use "darkgreen" as the colour
  2. Now we need to move the turtle into the centre of the circle

    The circle is half way down the flag, but 9/20ths of the way across – it's not quite in the centre

    So, move the turtle into a position 60 steps down the flag and 9/20ths of 200 steps across, so it's in the middle of where the circle will be

  3. The circle needs to have a radius of one fifth of the length of the flag.
  4. To draw the circle, use this code:
    color("red")
    begin_fill()
    circle(RADIUS)
    end_fill()

    You need to provide the RADIUS as a number

  5. Run your code. It won't work properly at first! That's deliberate!!
  6. Figure out what's wrong (hint: change the position of the turtle...) and run the code again
  7. You might need to do this a few times!

Getting the turtle into the right position isn't totally straightforwards here. Again, it all depends on which way it's facing to start with.