Writing an Algorithm Down: Flowcharts and Pseudocode
An algorithm can be recorded before any code exists, as a flowchart or as pseudocode. Both fix the order, the decisions and the repetitions, so the plan can be checked on paper and argued about with someone else.
What a learner can do afterwards
- Draw a flowchart for a task with at least one decision and one repetition, using the right shape for each
- Write the same algorithm as pseudocode and show the two agree step for step
- Find a missing or out-of-order step by walking the flowchart with a test value
1 · Read
An algorithm can be recorded before any code exists, as a flowchart or as pseudocode, like the strange programs you just read. Both fix the order, the decisions, and the repetitions. A plan on paper can be checked with a friend long before any code runs.
Pseudocode writes the plan in plain words, one short command per line, with capitals for actions. To ask for a password until it is right: ASK the user for the password. WHILE the password is wrong, ASK again. PRINT welcome. Indent the lines inside the loop so the repeat shows.
A flowchart draws the same plan with shapes. Ovals mark start and end, rectangles hold actions, diamonds hold decisions, arrows fix the order. The password loop becomes: ask, then a diamond asking if it is right, with a no arrow looping back to ask. Both forms must agree step for step.
Walk the plan with a test value, doing exactly what each line says. Try a wrong password first, then the right one. A missing ASK inside the loop, or two steps in the wrong order, shows up at once on paper.
Write the steps in plain words or shapes, then walk them with a test value.
2 · Watch
Take it off screen
Where it sits
Learn first
This opens up
Where this leads
Jobs that lean on this skill. Follow one to see everything it is built on.
8 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.