All paths

Thinking like a programmer

The habits behind the code, right after Python from zero: break problems down, spot patterns, read flowcharts, plan in pseudocode, trace by hand and debug, then build a sorting robot that shows its work in lights.

Raspberry Pi 4 Model BFree7 lessons5 h4 chapters1,710 XPCoding · Beginner+100 XP

0 of 7 done

What you will build

3 projects, built step by step

7 lessons in 4 chapters, about 5 hours on a simulated Raspberry Pi 4 Model B. Free, in your browser, every step checked by the simulator.

Chapter 1 project

Patterns and loops

Spot what repeats and what changes: turn hand-written lines into a loop, describe a rocket shape with a rule, find the pattern that adds 1 to 100 without adding, and store a beacon's blink pattern as data.

Open it in the simulator
Chapter 2 project

Pseudocode first

Plan in plain words before you write Python: turn pseudocode into code line by line to find the hottest of a day's hull temperatures, then the average and the hot hours, check your work against Python's built-ins, and raise an alarm.

Open it in the simulator
Chapter 3 project

Debug a recipe

Debug like a programmer, one bug at a time: predict what a recipe program should print, compare it with what it does, and fix a scaling formula upside down, a loop that skips the last step, two steps in the wrong order, and an egg count that rounds the wrong way.

Open it in the simulator
The map

Chapter by chapter

Each lesson opens when the one before it is done, and each chapter ends in a project.

Chapter 1

See the shape

Break a problem into parts and find what repeats.

  1. Open165 XP

    Break it down

    Decomposition: take a launch that is one long list of instructions, split it into named parts, give the parts inputs so one piece does many jobs, let a part answer GO or NO GO, and light the answer on the Pi.

    0 of 5 steps

  2. ProjectLocked330 XP

    Patterns and loops

    Spot what repeats and what changes: turn hand-written lines into a loop, describe a rocket shape with a rule, find the pattern that adds 1 to 100 without adding, and store a beacon's blink pattern as data.

    0 of 5 steps

4 questions, graded as you go.
Chapter 2

Plan before code

Flowcharts and pseudocode: the program drawn and written in words first.

  1. Locked150 XP

    Flowcharts to code

    Read a flowchart and write the code it draws: boxes in a row become lines in order, a diamond becomes an if, an arrow back becomes a loop, and a wait for a person becomes a button. On a real traffic light module.

    0 of 5 steps

  2. ProjectLocked380 XP

    Pseudocode first

    Plan in plain words before you write Python: turn pseudocode into code line by line to find the hottest of a day's hull temperatures, then the average and the hot hours, check your work against Python's built-ins, and raise an alarm.

    0 of 6 steps

4 questions, graded as you go.
Chapter 3

Check the work

Be the computer with a trace table, then debug one bug at a time.

  1. Locked165 XP

    Tracing by hand

    Be the computer: fill in a trace table for a loop before running it, print the trace to check yourself, trace a while loop to its last turn, find a swap bug on paper, and follow values through nested function calls.

    0 of 5 steps

  2. ProjectLocked330 XP

    Debug a recipe

    Debug like a programmer, one bug at a time: predict what a recipe program should print, compare it with what it does, and fix a scaling formula upside down, a loop that skips the last step, two steps in the wrong order, and an egg count that rounds the wrong way.

    0 of 5 steps

5 questions, graded as you go.
Chapter 4

Project

Every habit in one build: a sorting robot on the traffic lights.

  1. Locked190 XP

    Project: a sorting robot on LEDs

    The project: a robot that sorts cargo crates by weight. Draw the crates as bars, do one pass of neighbor swaps, repeat it into a full bubble sort, stop early when nothing moves, show every compare and swap on the traffic lights, and count the cost of the worst case.

    0 of 6 steps

3 questions, graded as you go.
Syllabus

Every lesson in the course

All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.

Chapter 1

See the shape

  1. Break it downDecomposition: take a launch that is one long list of instructions, split it into named parts, give the parts inputs so one piece does many jobs, let a part answer GO or NO GO, and light the answer on the Pi.
  2. Patterns and loopsSpot what repeats and what changes: turn hand-written lines into a loop, describe a rocket shape with a rule, find the pattern that adds 1 to 100 without adding, and store a beacon's blink pattern as data.
Chapter 2

Plan before code

  1. Flowcharts to codeRead a flowchart and write the code it draws: boxes in a row become lines in order, a diamond becomes an if, an arrow back becomes a loop, and a wait for a person becomes a button. On a real traffic light module.
  2. Pseudocode firstPlan in plain words before you write Python: turn pseudocode into code line by line to find the hottest of a day's hull temperatures, then the average and the hot hours, check your work against Python's built-ins, and raise an alarm.
Chapter 3

Check the work

  1. Tracing by handBe the computer: fill in a trace table for a loop before running it, print the trace to check yourself, trace a while loop to its last turn, find a swap bug on paper, and follow values through nested function calls.
  2. Debug a recipeDebug like a programmer, one bug at a time: predict what a recipe program should print, compare it with what it does, and fix a scaling formula upside down, a loop that skips the last step, two steps in the wrong order, and an egg count that rounds the wrong way.
Chapter 4

Project

  1. Project: a sorting robot on LEDsThe project: a robot that sorts cargo crates by weight. Draw the crates as bars, do one pass of neighbor swaps, repeat it into a full bubble sort, stop early when nothing moves, show every compare and swap on the traffic lights, and count the cost of the worst case.
Kits

Build it on your bench too

Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.

Have a kit already?

Find your kit

Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.

See every kit
Questions

About Thinking like a programmer

Is Thinking like a programmer free?

Yes. All 7 lessons of Thinking like a programmer are free and run in your browser, with nothing to install and no parts to buy before you start.

Do I need a real Raspberry Pi 4 Model B?

No. Every lesson runs on a simulated Raspberry Pi 4 Model B with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.

How long does Thinking like a programmer take?

About 5 hours: 7 lessons in 4 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.

What will I build?

Each chapter ends in a project that puts it together: Patterns and loops, Pseudocode first and Debug a recipe.

Where do I start?

With "Break it down", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.