GCSE · Computer Science · OCR · Spec J277
Algorithmic thinking
A robot sits in a tiny maze. It knows three commands: FORWARD, TURN LEFT and TURN RIGHT. No guessing allowed. To get it out, you'll spell out every step.
Step it through
Get the robot to the exit
The maze is a 3 × 3 grid. Columns A, B, C run left to right; rows 1, 2, 3 run bottom to top. The robot starts on A1 (bottom left), facing north (up). The exit is C3 (top right). The middle square, B2, is a wall.
Before you press Next: after the first two FORWARDs, which square will the robot be on?
1 // start: square A1, facing north2 FORWARD3 FORWARD4 TURN RIGHT5 FORWARD6 FORWARD7 // exit reached: square C3
Variables
Output
Step 1: Nothing has run yet. The robot is bottom left, the exit is top right, and the wall at B2 blocks the middle. All it has is your list.
Press Next to run one instruction at a time. Watch the highlighted line, then check the robot's square and direction.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
Get a robot out of a maze using three commands. Then find a second way out.
What you need to know
- Computational thinking is a structured, logical approach to solving problems.
- Algorithmic thinking is one computational thinking technique: you see the solution as a series of logical, step-by-step instructions.
- Those instructions, designed to solve the problem, are called an algorithm.
- Each instruction does one exact job: FORWARD moves the robot one square, and TURN RIGHT only turns it.
Have a goA robot is facing north. It runs TURN RIGHT, then TURN RIGHT again. Which way is it facing now?
South.
Each TURN RIGHT turns it without moving it: north to east, then east to south. East is the tempting answer, but that's after only one of the two turns.
- Order matters. The same instructions in a different order can send the robot somewhere else entirely.
- Logical steps fit together, so each one makes sense after the steps before it.
Have a goYour friend's toothbrushing algorithm: "Rinse. Brush. Put toothpaste on the brush." Every step is there. So why is your friend about to have a very minty sink?
The order is wrong: toothpaste has to go on before you brush.
Each step is fine on its own, but brushing only makes sense after the toothpaste step, so the steps aren't in a logical order.
- There's often more than one way to solve a problem.
- So the same problem can be solved by different algorithms, like Route A and Route B.
Have a goElla and Jake each write directions from the bus stop to the cinema. Their directions are different, and both get you there. How many algorithms is that?
Two: different steps, same problem solved.
It's tempting to think one of them must be the real one, but there's often more than one way to solve a problem, so each working set of steps is an algorithm.
- An algorithm is the instructions themselves, so a list written on paper still counts.
The big picture
Computational thinking is a structured, logical approach to solving problems. Algorithmic thinking is one of its techniques: you see the solution to a problem as a series of logical, step-by-step instructions. Those instructions, designed to solve the problem, are an algorithm. There is often more than one way to solve a problem, so the same problem can be solved by different algorithms.
Key points
Worked example
Problem
The wall moves! Same 3 × 3 maze: the robot starts on A1 facing north and the exit is C3. But now B3 is the wall and B2 is clear. Write an algorithm that gets the robot out using only FORWARD, TURN LEFT and TURN RIGHT.
⚠ Watch out
Thinking a problem has just one correct algorithm, so a different set of steps must be wrong. If two different step-by-step lists both solve the problem, both are algorithms: there's often more than one way to solve a problem.
Memory hook
Two routes, one exit: an algorithm is A way out, not THE way out.
Check yourself
Cover the page. In one sentence each: what is computational thinking, what is algorithmic thinking, and what is an algorithm? Then explain why Route A and Route B can both be right.
Flashcards
(7)What is computational thinking?
What is algorithmic thinking?
What do we call the step-by-step instructions designed to solve a problem?
Can the same problem be solved by more than one algorithm?
Algorithmic thinking or computational thinking: which one sits inside the other?
Why can't you shuffle the steps of an algorithm however you like?
Does an algorithm need a computer?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore OCR GCSE Computer Science topics
How this lesson was checked. This OCR GCSE Computer Science (specification J277)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 3 November 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.