Algorithms and sequences: 11+ computing lesson and practice questions
A 5-minute video lesson, the method for tracing any robot program, the mistakes children make most, and 10 practice questions with worked answers.
Wider curriculumComputingYears 5 and 6Free, no sign-up
To follow a robot's program, start on its square, note which way it faces, and carry out each command
in order: forward moves it that many squares the way it faces, and a turn is a quarter turn to the robot's own
left or right without moving. A repeat runs the commands in its brackets that many times.
For example, a robot on G6 facing left that follows forward 4, turn right, forward 1 moves to C6, turns to face
up the page, and finishes on C7.
Video lesson: algorithms and sequences
5 minutes 7 seconds. Captions are shown in the video, and the full transcript is below.Read the video transcript
Hi there! Today we're learning to follow a robot's program. A robot follows a program: commands in order, called an algorithm. Columns are letters across; rows are numbers from the bottom up, so this robot is on D1. Forward 2 moves two squares: count the squares it moves onto. A turn is a quarter turn on the spot: turn right, and it faces down, still on F1. Left and right are the robot's own: facing down, its left is the page's right.
This robot starts on D6, facing down: where does it finish? Sam says B5; let's trace it, square and facing each time. Forward 2 to D4; turn left: facing down, its left is the page's right, so it faces right. Forward 2 to F4; turn left, so it faces up; forward 1. So the answer is F5. B5 turns the wrong way, E5 counts the start square, and D1 ignores the turns.
How many squares does this robot move altogether? A repeat runs its brackets that many times; lines outside run once. One pass moves 5 squares, turns move nothing, so 3 passes make 3 times 5: 15. Then the forward 2 after them adds 2. So the answer is 17. The traps: 7 does the repeat once, 10 adds instead of multiplying, and 15 forgets the forward 2.
Which program makes the robot do exactly the same as this one? Forward 1 happens once, so it stays outside. The rest is forward 3, turn right, four times: eight lines, but four pairs. So the answer is option A. Option B counts lines, option C is one pass short, and option D turns only once.
Starting on F2, facing left, which program stops on the star at E6 without hitting the rock? Check the whole route, square by square. Option B: facing left, turn right points up the page; forward 4 to F6, turn left, forward 1. So the answer is option B. Option A hits the rock on E5, option C turns the wrong way, and option D goes one square too far.
Your turn: starting on B2, facing right, which program stops on the star at F6 without hitting a rock? Pause the video and trace each one. Option D: each pass goes one right, one up, like a stair, so four passes reach F6. So the answer is option D. Option A is one pass short, option B turns the wrong way, and option C hits the rock on F3.
Let's review: count the squares moved onto; a turn stays on its square. A repeat runs its brackets that many times; lines outside run once. Check every square of a route. Well done! Now try some questions to show what you know.
The method in four steps
Read the grid. In these questions the columns are letters across and the rows are numbers counted from the bottom up. Find the robot's start square and the way its arrow points.
Unpack any repeat. The commands inside the brackets run as many times as the number says. Commands outside the brackets run once, before or after the repeat.
Trace one command at a time. Write the square and the facing after every command. Forward moves the robot that many squares the way it faces: count the squares it moves onto, not the one it starts on. A turn is a quarter turn on the same square, to the robot's own left or right.
Answer the question asked. For the finish square, give the last square. For the number of squares moved, add up the forward moves only. For "which program works", check every square on the route: no rock, no driving off the grid, and the robot must stop on the target.
Some questions ask which shorter program does exactly the same as a long one. Split the long
program into the group of commands that keeps coming back, count how many times the group appears, and put
only that group in the brackets. For example, forward 5, turn left, forward 5, turn left, forward 5, turn left
is the group "forward 5, turn left" three times, so it can be written as repeat 3 [forward 5, turn left]. Any
command that happens only once stays outside the brackets.
Worked examples
These examples use a bigger grid, with columns A to G and rows 1 to 7.
Example 1: where does it finish?
A robot starts on B7, facing down. It follows: forward 2, turn left, forward 4, turn left, forward 2. Where does it finish?
Forward 2, moving down the page: B6, B5. It is on B5, facing down.
Turn left: facing down, the robot's left is the page's right, so it now faces right. Still on B5.
Forward 4: C5, D5, E5, F5. It is on F5, facing right.
Turn left: facing right, its left is up the page. Still on F5.
Forward 2: F6, F7. The robot finishes on F7.
Example 2: a repeat and a line after it
A robot starts on G1, facing up. It follows: repeat 3 [forward 4, turn left], then forward 1. How many squares does it move altogether, and where does it finish?
One pass of the brackets moves 4 squares. The turn moves nothing.
3 passes move 3 × 4 = 12 squares. The forward 1 after the brackets runs once: 12 + 1 = 13 squares.
Route: up to G5, turn to face left; across to C5, turn to face down; down to C1, turn to face right.
Then forward 1 to D1. It moves 13 squares and finishes on D1.
Example 3: which program reaches the star?
A robot starts on E7, facing down. It must stop on the star at C5 without driving onto the rock at E5. Which of these works?
Program 1, forward 2, turn right, forward 2: the route is E6, then E5, which is the rock. It would go on to finish on C5, but it drives onto the rock on the way, so it fails.
Program 2, turn right, forward 2, turn left, forward 2: facing down, turn right points to the page's left. It goes to D7 and C7, turns left to face down, then goes to C6 and C5. No rock on the way, and it stops on the star. It works.
Program 3, turn left, forward 2, turn right, forward 2: facing down, turn left points to the page's right. It goes to F7 and G7, then down to G6 and G5. It ends on G5, not the star.
So Program 2 is the one that works.
Common mistakes
Counting the start square. Forward 2 from G3, facing up, lands on G5. Counting G3 as the first square stops the robot on G4.
Using the page's left instead of the robot's. When the robot faces down the page, its left is the page's right. Turning the wrong way sends it to the mirror-image square.
Moving on a turn. A turn changes only the way the robot faces. It stays on the same square.
Doing the repeat once, or adding. Repeat 3 [forward 5, turn right] moves 3 × 5 = 15 squares, not 5 and not 3 + 5 = 8.
Forgetting the lines outside the brackets. A command written after the repeat runs once more at the end, and it still counts.
Checking only the last square. A program that ends on the target but passes over a rock on the way does not work.
Counting lines instead of groups. Six lines made of the pair "forward 5, turn left" are 3 pairs, so the repeat number is 3, not 6. And repeat 3 [forward 5], turn left is different again: it goes 15 squares in a straight line and turns once.
10 practice questions with answers
Tap an answer to check it, or open the worked answer. The questions start simple and finish at the level of a harder 11+ question.
1.A garden watering robot starts on A3, facing right. It follows the program. On which square does it finish?
D2
C3
E3
D4
Show the answer
D2. Forward 3 from A3, facing right: B3, C3, D3. Turn right: facing right, the robot's right is down the page, so it now faces down on D3. Forward 1 takes it to D2. (D4 is the answer if it turns left instead.)
2.A snowplough in a game starts on B1, facing right. It follows this program. How many squares does it move altogether?
12
7
15
3
Show the answer
12. One pass of the brackets moves 3 squares, and the turn moves nothing. The brackets run 4 times, so 4 × 3 = 12 squares. The route goes round a square, B1 to E1 to E4 to B4 and back to B1, and stays on the grid. (3 is one pass only; 7 adds 4 + 3.)
3.A museum guide robot starts on A1, facing right. It must stop on the star at D3 and must not drive onto the rock. Which program works?
turn left, forward 2, turn right, forward 3
forward 3, turn left, forward 3
forward 3, turn right, forward 2
forward 3, turn left, forward 2
Show the answer
forward 3, turn left, forward 2. Forward 3 goes B1, C1, D1. Facing right, a left turn points up the page, so forward 2 goes D2, D3 and stops on the star. The first program goes up to A3 and then along row 3, onto the rock at C3. The second goes one square too far, to D4. The third turns down the page and drives off the grid.
4.A robot waiter in a cafe starts on B5, facing down. It follows the program. On which square does it finish?
A2
C2
B1
B3
Show the answer
C2. Forward 3 down the page: B4, B3, B2. Now the turn. The robot faces down, so its own left is the page's right. After turn left it faces right, and forward 1 takes it to C2. (A2 is the answer if you turn to the page's left.)
5.A robot in a maze game starts on D3, facing up. It follows this program. How many squares does it move altogether?
8
11
9
5
Show the answer
11. The brackets move 2 squares each pass, 4 times: 4 × 2 = 8 squares. Line 2 is outside the brackets, so it runs once more: 8 + 3 = 11 squares. (8 forgets line 2.)
6.Which program makes the robot do exactly the same as this one?
repeat 2 [forward 2, turn right]
repeat 6 [forward 2, turn right]
repeat 3 [forward 2, turn right]
repeat 3 [forward 2], turn right
Show the answer
repeat 3 [forward 2, turn right]. The six lines are the pair "forward 2, turn right" three times. Repeat 6 counts lines instead of pairs, repeat 2 is one pair short, and the last option moves 6 squares in a straight line and turns only once.
7.A floor robot on a classroom mat starts on F2, facing left. It must stop on the star at E4 and must not drive onto the rock. Which program works?
forward 3, turn right, forward 2, turn right, forward 2. Forward 3 goes E2, D2, C2. Facing left, a right turn points up the page: C3, C4. Facing up, a right turn points right: D4, E4, the star. The route goes round the rock. The first program goes one square too far, to F4. The second turns down the page and drives off the grid. The third goes straight up from E2 onto the rock at E3.
8.A robot in a maze game starts on B1, facing right. It follows the program. On which square does it finish?
D6
D3
E5
B3
Show the answer
E5. First pass: forward 1 to C1, turn left to face up, forward 2 to C3, turn right to face right. Second pass: forward 1 to D3, turn left to face up, forward 2 to D5, turn right to face right. Line 2: forward 1 to E5. Each pass is one step right and two steps up, like a staircase. (D3 stops after one pass.)
9.A rover on a model Mars base starts on A1, facing right. It must stop on the star at C3 and must not drive onto a rock. Which program works?
repeat 2 [forward 1, turn left, forward 1, turn right]. First pass: B1, turn to face up, B2, turn to face right. Second pass: C2, turn to face up, C3, turn to face right. It stops on the star and passes no rock. The second program goes up to A2 and then onto the rock at A3. Three passes carry on past the star to D4. The last program turns right on B1, which points the rover down the page and off the grid.
10.Which program makes the robot do exactly the same as this one?
repeat 3 [forward 1, turn right, forward 2]
repeat 9 [forward 1, turn right, forward 2]
repeat 3 [forward 1, forward 2], turn right
repeat 2 [forward 1, turn right, forward 2]
Show the answer
repeat 3 [forward 1, turn right, forward 2]. Lines 1 to 3, lines 4 to 6 and lines 7 to 9 are the same group of three commands, so the group runs 3 times. Repeat 9 counts lines, repeat 2 is one group short, and the third option leaves the turns out of the brackets, so the robot would move 9 squares in a straight line and turn once.
Want more algorithms and sequences practice?
Inside ElevenReady your child gets hundreds more computing and wider-curriculum questions at the right
level, a short lesson before each new skill, and a parent dashboard that shows which skills are secure and
which need work. Start with 30 days free. No card needed.
Schools whose 11+ includes wider-curriculum questions
Wider-curriculum questions, which can draw on any Key Stage 2 subject, are part of the FSCE test used by the
Gloucestershire grammar schools below, and computing questions like these are practice for that breadth.
GL-style tests do not include them, so most children sitting a GL test will not see a question like these. The schools, with the subjects our school directory lists:
Sir Thomas Rich's SchoolGloucester. FSCE: English, Maths and questions across the wider curriculum
Denmark Road High SchoolGloucester. FSCE: English, Maths and questions across the wider curriculum
Ribston Hall High SchoolGloucester. FSCE: English, Maths and questions across the wider curriculum
Marling SchoolStroud. FSCE: English, Maths and questions across the wider curriculum
Stroud High SchoolStroud. FSCE: English, Maths and questions across the wider curriculum
The Trafford grammar schools move from GL to FSCE for 2028 entry; check each school's admissions page for
whether its papers include wider-curriculum questions.
Subjects taken from our school directory in November 2026. Exam arrangements change, so
always check the school's own admissions page for the year your child applies.
Questions parents ask
What is an algorithm?
An algorithm is a precise set of steps, in order, that does a job or solves a problem. A program is an algorithm written so that a computer or a robot can carry it out. The robot does exactly what each step says, in order, so one wrong step changes everything after it.
Why does the robot's own left matter?
Turn left and turn right mean the robot's own left and right, not the left and right of the page. When the robot faces up the page, the two match. When it faces down the page, they swap: its left is the page's right. A good habit is to turn the page, or imagine sitting in the robot, before each turn.
When do children learn about algorithms at school?
In England, the computing curriculum is set out by key stage, not by year. In Key Stage 1, children learn what algorithms are and that programs follow precise and unambiguous instructions. In Key Stage 2, they design, write and debug programs that use sequence, selection and repetition, which includes repeat loops like the ones on this page.
Are robot program questions in the 11+?
They are wider-curriculum questions, which belong only in tests that include the wider curriculum, such as the FSCE test used by some Gloucestershire grammar schools. Those questions can draw on any Key Stage 2 subject, so the questions on this page are practice for that breadth, not a promise that a robot program question will appear. GL-style tests of English, maths and reasoning do not include wider-curriculum questions.