Skip to content
RoboLearn
Not completed

Pseudocode and flowcharts

ProgrammingBeginner20 minTurn pseudocode into code ↓Before this: Algorithms and sequences

What you’ll learn

  • How to write pseudocode
  • How to draw a flowchart
  • How to turn either one into real code

Pseudocode

Pseudocode is code-like plain English. It isn’t a real language, so there’s no syntax to get wrong; it’s for thinking.

forever:
read distance
if distance < 20 cm:
turn left
else:
drive forward

Flowcharts

Shape Meaning
Rounded box (oval) Start / end
Rectangle An action: “drive forward”
Diamond A decision with yes/no arrows: “distance < 20?”
Parallelogram Input or output: “read sensor”, “print”
Arrows The order of steps
(Start)
│
[Read distance] ◄──────────┐
│ │
<dist < 20?> ─yes─► [Turn left] ─┤
│ no │
[Drive forward] ──────────────────┘

Why plan first?

Bugs are much cheaper to fix on paper. Walking through a plan with a few example values (“what if the distance is 15? 50?”) catches mistakes before you write a line of code.

Finished this lesson?