Skip to main content
Skip to main content

Design a flag
with Pencil Code

Integrating Digital
Technologies

Years 5-6

DT+ HAAS: Civics and Citizenship


Design your own Australian flag by firstly examining common elements of flags, creating a step by step process (algorithm) to program your design after exploring a ‘block-based’ turtle drawing program such as Pencil Code.


Example code from Pencil Code


Learning hook

Investigate designs of flags from around the world and look specifically at the features of these flags. What are common elements? What geometric shapes are used? How could you create a computer program to recreate a flag design?

Examine the Australian Flag, the Australian Aboriginal Flag and the Torres Strait Islander Flag, and discuss the significance of the symbols on all of them. Centre discussions around reconciliation. Ask students to design a new Australian flag that would foster inclusivity and togetherness and have relevance for future generations.

Note: You may decide to integrate this task with HAAS: Civics and Citizenship

Learning map and outcomes

Explain that students will:

  • develop their understanding of iterations and how these can be used in programming
  • understand that iteration represents repeated sequences that are taken when developing algorithms
  • apply data input and output in algorithms for iterations.

Suggested steps

  1. Students visit Flags of the world or other similar websites to become familiar with the design of different flags from around the world.
  2. Before programming their own flag design, students design their flag. They could use one of the more basic interactive flag design websites, such as Scrontch’s Flag Designer, to become familiar with the use of colours and features used in the design of most flags around the world. It may also help students become familiar with how to work within the available spatial dimensions if they draw the Australian Aboriginal Flag and the Australian Flag. Examine features on flags and consider proportion.
  3. Ask students: If you were to program making this flag you have designed, what functions could you use?
  4. Mention some of the terminology the students will need to know or come across using Pencil Code: repetition, iteration, loops.
  5. Using Pencil Code, further introduce students to the term ‘iteration’. Create some basic shapes so they become familiar with the function.
  6. Go to the Pencil Code Guide and look at loops and how they function with data input and output. If you can make a loop for a star, how can you use this idea to design a flag? (Allow the students to use a protractor to help them when working out angles.)
  7. To familiarise themselves with Pencil Code, students could recreate the Australian Aboriginal Flag. Use the iteration for a rectangle. Add in the conditional data to make the rectangles in the flag. This also presents an opportunity to create an algorithm of the process that describes the steps. Talk about creating the program with the least number of steps.
    Code for Australian Aborigianl Flag

    NB: The Australian Aboriginal Flag is © Harold Thomas.

    image of Australian Aborigianl Flag
  8. It may be useful to follow a similar approach with the Australian Flag. Using the same iteration functions from Step 7, create the basic outline for the Australian Flag. Take a look at how to create a star.
    Pencil Code used to create a star, screenshotted image of code used and the resulting star
  9. Once students have become familiar with these functions, you may also like to investigate the Torres Strait Islander Flag.
  10. Using Pencil Code, design what you think a new Australian flag could look like.
  11. Share designs, with student pairs swapping feedback based on agreed criteria.

NOTE: In this task, Pencil Code is suggested as a relevant tool; however, you may decide to use a different turtle drawing program. Pro-Bot is also an option.

Discussion

Programmers use iterations or loops to save time, repeat steps and simplify algorithms.

  • Have you programmed the code for your flag in the least amount of steps possible?
  • In what ways have you simplified your program? What blocks did you use?
  • If you used loops, how did you work out how many times to repeat the steps?

Why is this relevant?

Using iterations or loops is a more efficient way of coding. Programmers use this approach to repeat a sequence of steps until a condition is met. Being able to repeat a process can help to simplify algorithms and remove unnecessary steps. Iterations give the user the ability to program a short sequence of actions rather than using longer code. Loops tell the program how many times to repeat a sequence and when to stop. They can have conditions with variables in the code that tell the output to change depending on the user input. This video CS Principles: Using Loops provides further detail about how it works.

Code for white pen