Scratch
Intermediate
40 mins
Teacher/Student led
+55 XP

Pseudo-code and Flow Charts: Plan It, Then Build It

Write a quiz algorithm as pseudo-code and as a flow chart, build and match-check it in Scratch, then extend the plan, swap with a classmate, and flag where the wording needs to be more precise.

Teacher Class Feed

Load previous activity

    1 - Start ~4 mins

    Illustration for StartEarlier you used the four steps of computational thinking to break a build down and make it. One of those steps was algorithms: writing the steps of a solution in order.

    Today you learn two ways coders write an algorithm down before they touch a block: pseudo-code (plain steps in order) and a flow chart (the same plan drawn as boxes and arrows). You will plan a small quiz, then build it in Scratch and check the program matches the plan.

    2 - Two Ways to Write a Plan ~2 mins

    Quiz plan as a flow chart

    An algorithm is a clear set of steps that solve a problem. Coders write it down before they build, so anyone reading the plan knows exactly what should happen.

    Today you will write the same plan two ways: as a words plan and as a shapes plan.

    • Pseudo-code is the words plan: plain words, one step per line. Not a real programming language, just precise enough that someone else could follow it.
    • Flow chart is the shapes plan: the same plan drawn as shapes and arrows. An oval starts and ends it, rectangles are actions, and a diamond is a yes-or-no decision.

    3 - The Quiz You Will Build, as Pseudo-code ~3 mins

    Here is the plain-English idea you will plan and build today:

    A sprite asks for a name and greets them. It then asks how many counties are in Ireland. If the answer is 32, the score goes up by 1 and it says "Correct!". If not, it says "Not quite".

    Here is that idea as sample pseudo-code you can imitate:

    1. START
    2. SET score to 0
    3. ASK for a name
    4. SAY hello using the name
    5. ASK how many counties are in Ireland
    6. IF the answer equals 32 THEN
    7. change score by 1
    8. SAY Correct!
    9. ELSE
    10. SAY Not quite
    11. END

    The shapes plan draws these same steps in the same order. The one line that becomes a diamond is line 6, the yes-or-no check: yes goes one way, no goes the other. Your teacher will draw this shapes plan on the board as you talk through it.

    And here is the same plan as Scratch blocks. Read it against the pseudo-code above, line for line — every line has a block:

    when green flag clicked set [score v] to (0) ask [What is your name?] and wait say (join [Hello ] (answer)) ask [How many counties are in Ireland?] and wait if <(answer) = [32]> then change [score v] by (1) say [Correct!] else say [Not quite] end

    4 - Write the Pseudo-code and Draw the Flow Chart ~5 mins

    Turn the quiz idea into a plan on paper or in a notes file. Use the sample as a model.

    1. Write the pseudo-code. Write the quiz as ordered steps. Every action and every decision needs its own line. You must include SET score to 0, the counties question, the check for 32, the score change, and both messages. Include the name and greeting as well if you can.
    2. Draw the flow chart. Redraw the same plan as shapes and arrows. Use an oval for start and end, rectangles for actions, and a diamond for the yes-or-no check on the answer. Label the arrows out of the diamond with yes and no.

    5 - Get Something Running Early ~2 mins

    1. Get something running early. As soon as you have at least two solid pseudo-code lines (for example SET score and ASK name), open a new Scratch project and place those blocks so something already runs. Come back to finish the rest of the plan, then add the remaining blocks in the next step.
    123learn · Online learning platform

    Unlock the full learning experience

    You're previewing this lesson. Get full access to this lesson and hundreds more — each one ready to teach, with interactive activities, printable resources and pupil progress tracking built in.

    Hundreds of curriculum-aligned lessons
    Interactive activities in every lesson
    Printable resources & progress tracking
    Copyright Notice
    This lesson is copyright of Coding Ireland 2017 - 2025. Unauthorised use, copying or distribution is not allowed.

    Scratch is developed by the Lifelong Kindergarten Group at the MIT Media Lab. It is available for free at https://scratch.mit.edu
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more