- Learn
- Computer Science & IT
- Computing and Coding for Ages 7 to 11
- Sequences and Debugging
First Programs, Sequences and Debugging
Kindergarten, Grade 1Lesson 1 of 10 in Computing and Coding for Ages 7 to 11 Course
What you will learn
- Find out what commands, programs and code are, and build short programs that make a floor robot or a character on a screen do what you want.
- Learn what commands, programs and code areLearn the words programmers use, see why a robot follows code exactly, and find out when the order of commands changes what happens.
- Program a floor robot to reach a targetUse forward, backward and turn commands to send a floor robot across a mat of squares, and write your program down with arrows.
- Build a program with blocks for a spriteSnap command blocks together to make a character on a screen move, talk and play sounds, starting the same way every time.
- Learn what commands, programs and code are
- Read a program before you run it, work out what will happen step by step, and explain your thinking.
- Follow a program one step at a timeTrace a program with your finger or a counter, keep track of where the robot is and which way it faces, then run it to check your prediction.
- Explain your prediction and what a change will doUse what you know about each command to give reasons, compare programs, and work out what happens when you change the code.
- Follow a program one step at a time
- Spot what kind of mistake is in a program, track down exactly where it is, fix it and test again until the program works.
- Spot the kinds of bugs in a programLearn what a bug is and recognize the mistakes that often happen in a sequence: wrong order, a missing step, an extra step, the wrong command and the wrong number.
- Find where the bug isUse debugging strategies to track down the exact command that is wrong: compare what you wanted with what happened, step through the code, and talk it through with a partner.
- Fix the bug and test againMake one small change to fix the bug, run the whole program again from the start, and keep going until it works.
- Spot the kinds of bugs in a program
- Choose a goal, plan the steps, turn your plan into code and test it as you go, so your own program works and is easy to follow.
- Turn a plan into codeDecide what your program should do, plan the steps as an algorithm, and change each step into commands the robot or sprite understands.
- Test as you build and make your program betterTest your program often while you build it, check it against your goal, tidy it up and learn from the bugs you find.
- Turn a plan into code
Sequences and Debugging study guide
1Give your robot a job
You can make a robot travel or a screen character talk. First, you choose commands and put them in order. You will try command cards, buttons, and blocks, and see how each one works. The robot’s front and the sprite’s screen give you different ways to think about a move.
1.1 Commands make things happen
You can tell a robot what to do with a command. One command gives one instruction, such as "move forward". A list of commands for a robot or computer is a program.
Make a plan, then write code
An algorithm is a plan made of steps for a job. Think about brushing your teeth. You put toothpaste on the brush before you brush. Each step has a place in the plan.
A program is a plan written in commands a computer understands. Those commands are called code. Writing them is coding, or programming. Your robot may understand "forward" but have no command called "visit the door". You must break that job into commands it knows.
Put the commands in order
The order of commands is a sequence. In these programs, the robot follows one command, then the next. It starts with the first and works toward the last.
Imagine a robot facing away from you. Compare these programs:
| Program | What happens |
|---|---|
forward, turn right | It moves one square ahead, then faces right. |
turn right, forward | It faces right, then moves one square to that side. |
The commands are the same, but their order changes the stop square. The robot cannot guess that you meant the other route.
Sometimes a swap keeps the same result. On a number track, start at 0. Move forward 3, then forward 2: you stop at 5. Start at 0 again. Move forward 2, then forward 3: you also stop at 5. Trace the moves to check a swap.
Play the robot game
Lay command cards in a row. One person reads the cards. Another acts as the robot, following each card exactly. Use "step forward", "turn left", and "turn right" on a clear path. If the route misses the target, look at the cards. The person acting as the robot should not guess a better route.
People write programs for tablet games, washing machines, microwaves, and traffic lights. The commands make different things happen, but their order still matters.
Key Takeaways
- A command tells a robot or computer to do one thing.
- An algorithm is a step-by-step plan; a program writes the plan as code.
- A sequence is the order of commands.
- Trace a change in order to check what it does.
1.2 Send a floor robot across a mat
A floor robot follows commands you enter with its buttons. On a mat made for that robot, one move takes it one square. First choose a start square and the way its front will face.
Know what each button does
| Command | What the robot does |
|---|---|
forward | Moves one square the way its front points. |
backward | Moves one square behind it without turning. |
turn left | Makes a quarter turn left on the same square. |
turn right | Makes a quarter turn right on the same square. |
To reach the square on its right, use turn right, forward.
Left and right belong to the robot. If it faces you, its right is on your left. Stand behind it, or face the same way with your own body. Now your right matches the robot’s right.
Count the moves to the cheese
The cheese is 2 squares ahead, then 1 square right. Trace that path with a finger. Count each new square you enter. Do not count the start square as a move.
forward: move onto the first square ahead.forward: move onto the second square ahead.turn right: stay on that square and face right.forward: move onto the cheese.
The full program is forward, forward, turn right, forward.
Write arrows before pressing buttons
You can use arrows to record the commands:
↑means forward.↓means backward.↰means turn left.↱means turn right.
The cheese program is ↑ ↑ ↱ ↑. The forward arrow means "follow the robot’s front". After a turn, it does not mean "go toward the top of the paper".
Get ready to run
On many floor robots, button presses stay in memory. New presses join the old commands. Press Clear before entering a new program on these robots. Then press the command buttons in the order you wrote.
Put the robot on Start, facing the planned way. Press Go to run the whole program. If the robot misses the target, check its start square and facing as well as the commands.
Key Takeaways
- Forward follows the robot’s front; backward moves behind it without turning.
- A left or right turn is a quarter turn on the spot.
- Use the robot’s left and right.
- Count new squares, leaving out the start square.
- Clear stored commands before entering a fresh program, then use Go to run it.
1.3 Make a sprite move, speak, and play sounds
A sprite is a character or object you can control on a screen. It could be a cat, a car, or a ball. Select the sprite you want to program, then drag blocks into its code area.
Snap the blocks together
Connected blocks make a sequence. Some apps read left to right. Others read top to bottom. Follow the direction your app uses. A loose block does not run with the connected program.
Put a start block such as "when green flag clicked" first. Pressing the green flag starts the attached blocks. Each sprite has its own code, so check that you selected the right character.
Choose what happens
Motion blocks move or turn your sprite. Many have a number you can change. In an app that counts grid squares, "move right 3" moves three squares. It reaches the same place as three "move right 1" blocks.
Read the command words carefully. A screen command called "move right" can move toward the screen’s right side, whichever way the sprite faces. A floor robot’s forward command follows its front.
Looks blocks can show words, change size, hide, or show the sprite. Sound blocks play sounds. They belong in the sequence too.
Help the cat reach a ball
The ball is 4 grid squares to the cat’s right. You want the cat to reach it before speaking.
- Start with "when green flag clicked".
- Snap on "move right 4".
- Snap on "say Got it!".
Press the flag. The cat moves first, then says "Got it!". Swapping the last two blocks makes it speak before moving.
Play notes in order
Sound order changes a tune. "Do, re, mi, do" begins "Are You Sleeping, Brother John?". "Mi, re, do, do" has a different order. In apps with both sound choices, "play sound until done" waits for a sound to finish. "Start sound" lets the next block begin straight away, so sounds can overlap.
Give each test the same start
Place a "go home" or position block just after the start block. It puts the sprite back in its start place. A position reset sets only its place. If your program changes its facing, size, or whether it shows, add blocks to set those back too. A hidden sprite needs "show"; moving it home alone will not make it visible.
Key Takeaways
- A sprite is a screen character or object controlled by code.
- Snap blocks together and place a start block first.
- Each sprite has its own code.
- Read movement words and numbers before planning a path.
- Looks and sound blocks run in the sequence too.
- Reset every starting feature that your program changes.
2Work out the route before running
You can work out a program’s journey before it starts. Use a counter or your finger to follow each command. Keep track of turns as well as moves. Then you can explain your answer and compare two routes, even when they reach the same place.
2.1 Trace each command
Before you run a program, predict what it will do. A prediction says what you think will happen. You can work it out by tracing: follow the code one command at a time.
Give your counter a front
Put a counter on the start square. Draw a small arrow on it to show its front. Point to the first command and act it out. Then point to the next command.
Keep track of two things: the square and the facing. A forward or backward changes the square. A turn changes the facing. Keep the counter on the same square while it turns.
Follow a route with two turns
Start facing toward the top of the mat. Trace this program:
forward, forward, turn left, forward, turn left, forward
- The first forward takes you one square ahead of Start.
- The next forward takes you two squares ahead of Start.
- Turn left on that square. Your front now points left.
- Move one square left.
- Turn left again. Your front now points toward the bottom.
- Move one square toward the bottom.
You finish one square ahead of Start and one square left. You face the bottom of the mat. Count the moves after each turn in the new facing direction.
Leave a trail on paper
For a longer program, write a short note after each command. For the first three steps above, your notes could be "1 ahead", "2 ahead", and "2 ahead, facing left". The last note tells you the final square and facing.
A turn takes a step in your list, but no step across the mat. If you move onto a new square during a turn, your trace will put every later move in the wrong place.
Trace a sprite too
Read "when green flag clicked", "move right 2", "move up 1", "say Hi!". The flag starts the code. The sprite moves two grid squares right, then one up. Only then does it say "Hi!".
Now run the program and watch each action. If the result differs from your prediction, read the commands again. You may have traced a move wrongly, or the code may need a fix. Find the step where your trace and the run first part ways.
Key Takeaways
- Predict before running, then check by watching the run.
- Trace every command in order.
- Track both the square and the facing.
- Keep your counter still during a turn.
2.2 Give reasons and compare changes
A prediction is stronger when you can say why. Logical reasoning means using what you know about each command to work out what happens. You might say, "It reaches the flower because three forward moves cover the three squares."
Compare two routes
Start with a robot facing ahead. A star is one square ahead and two squares right. Trace each program from the same start.
- Program A:
forward, turn right, forward, forward. - Program B:
turn right, forward, forward, forward.
Program A moves one ahead, then two right. It reaches the star. Program B turns before moving. It travels three squares right along the start row, so it misses.
There is another route to the star: turn right, forward, forward, turn left, forward. It goes right first, then ahead. Both that route and Program A reach the target. The paths differ, and their final facing differs too.
Think about one change
If "forward 3" becomes "forward 2", that move ends one square sooner. The next command begins from the new place. Trace the rest to see where the whole program ends.
Changing a left turn to a right turn changes the facing at that point. Later forward moves follow that new direction. Do not change only the turn in your drawing and leave the later path untouched.
Spot commands that undo each other
A right turn followed by a left turn puts the front back where it was. Both turns happen on the same square. So forward, turn right, turn left, forward ends where forward, forward does, with the same facing.
Use a miss as a clue
A robot stops short of a flower. First check its start square and facing. Then trace the code. On a straight path from the right start, a missing forward move may explain the miss. A wrong turn or number can also cause a miss. Look at the actual steps before choosing a fix.
If a prediction was wrong, ask, "Which step surprised me?" Act out that command. Its meaning helps you explain what happened.
Key Takeaways
- Explain a prediction using what each command does.
- Trace each program from the same start when comparing routes.
- Different paths can reach the same target.
- After changing a command, trace the later commands too.
- Check the start and trace before deciding why a target was missed.
3Find the bug and try a fix
A robot can finish its program and still miss its target. Watch what happens and compare it with your plan. You will learn to spot the first wrong step, make a small fix, and try again. Each test gives you a clue about what needs to change.
3.1 Recognize a bug
A bug is a mistake in code that stops the program doing what you wanted. Debugging means finding and fixing bugs. Even expert programmers need to do it.
Look at the kind of mistake
| Bug | What to look for |
|---|---|
| Wrong order | Needed commands are there, but in the wrong places. |
| Missing command | A needed step is not there. |
| Extra command | The list has a step you do not need. |
| Wrong command | One command should be a different command. |
| Wrong number | A block’s number is too large or too small. |
These clues help you choose what to inspect. Check them against your goal and your route.
Compare code with the job
The cheese is two squares ahead and one right. The robot starts facing ahead. The program is forward, turn right, forward, forward. It goes only one ahead before turning, then two right. All four needed commands are there. The order is wrong. Use forward, forward, turn right, forward.
A flower three squares straight ahead needs three forward moves. A list with two forwards has a missing command. A list with four forwards has an extra command and goes past the flower.
A left turn in place of a needed right turn is a wrong command. A sprite’s "move right 5" goes past a ball four squares right. Its number should be 4.
Listen for a sound bug
In some apps, "start sound" begins a sound and moves straight on. Two of these blocks can start sounds that overlap. If you want one sound to finish before the next begins, use "play sound until done" blocks. The wrong sound-block type can make your tune run together.
Check more than the code
The robot may begin on the wrong square or face the wrong way. On a robot that keeps commands, an old list may remain because Clear was missed. Check these before changing a correct route.
A program can have a bug even when it runs to the end. Watch what it does and compare that with your goal. Finishing a list is not the same as reaching the target or playing the sounds in order.
Key Takeaways
- A bug stops the program doing what you wanted.
- Look for wrong order, missing or extra commands, a wrong command, or a wrong number.
- Check sound blocks when sounds overlap.
- Check the start and stored commands before changing code.
- Compare the result with the goal, even when the code finishes.
3.2 Find the first wrong step
Finding a bug is easier when you know what you expected. Say the goal and the result: "I wanted the robot on the ball. It stopped on the other side."
Watch where the route first changes
Start facing ahead. The ball is one square ahead and two left. Your code says forward, turn right, forward, forward.
The first forward matches your plan. At the second command, the robot faces right. Your plan needs it facing left. This is the first wrong step, even though it has not left the square yet. The right turn is the bug.
Later moves may follow their commands correctly but still start from the wrong facing. Work from the first difference so you do not try to repair every later square separately.
Step through slowly
Point to one command at a time. Act it out with a counter, then compare it with the drawn route. Keep the arrow cards next to the mat so you can check both together.
Stop when a command differs from the plan. A needed command might also be missing just before that point. If your plan needs a turn but the next command is forward, check for the missing turn.
Make a fast program easier to watch
A sprite can move so quickly that you only see its last place. Put a "wait" block between actions to slow the run. Now you can notice whether it spoke too early or moved too far.
You can also test just the first few commands. Start from the planned start and run that part. If it reaches the right square and facing, look later in the code. When you test a longer part, begin from the same start again.
Talk through the blocks
Tell a partner what each block does. You can even tell a toy: "First it moves ahead. Next it turns right." Speaking the turn’s name may help you hear that it should be left. A partner can check the route while you point to the code.
If nothing starts, check the starting things. Is a start block attached? Are the blocks on the right sprite? For a floor robot, check Start, facing, and cleared memory before looking for a wrong move.
Key Takeaways
- Say what should happen and what actually happened.
- Step through until the first difference from the plan.
- A turn can be the first wrong step without changing squares.
- Use short tests or wait blocks to see the actions.
- Explain the code aloud to help find a bug.
3.3 Make a small fix and run again
Once you find the bug, change the part that is wrong. Keep the parts that already do their jobs. You might swap commands, add one, remove one, or change a command or number.
Fix the turn
The ball is one square ahead and two left. The robot starts facing ahead. You found the wrong turn in forward, turn right, forward, forward.
Change just turn right to turn left. Your new program is forward, turn left, forward, forward. The first move still takes the robot one square ahead. The new turn faces it left. The last two moves take it to the ball.
Changing the first forward would not fix that wrong turn. Match your change to the clue you found.
Test one change at a time
Make one change, then test. If you change the turn and remove a forward together, the result changes in two ways. You will not know which change helped.
Use the same starting things for the test:
- Put the robot back on Start.
- Face it the planned way.
- Clear stored commands and enter the fixed program.
- Press Go and watch the whole route.
For a sprite, reset the starting place and any changed facing, size, or showing. Then press the green flag.
Check the whole job
A fix might let the robot get farther and reveal another bug. It could make the right turn but still stop short. Check all the steps, including the last move, words, and sounds. Keep finding and fixing bugs until the whole program meets your goal.
If your change did not help, change it back and trace again. Look for the first difference between the plan and the run. You do not need to start a completely new program each time.
You can say, "I haven’t fixed it yet." A test tells you what to look at next. When you spot the next bug, make another small change and try again.
Key Takeaways
- Change the part that is wrong and keep the working parts.
- Fix one thing, then test.
- Restart from the planned place and facing.
- Run the whole program to check for more bugs.
4Make your own working program
Choose a small job for your robot or sprite. You might send a car to a garage or make a character greet a friend. Draw or tell the steps before you build. Then test a little at a time, and make your code easy for someone else to follow.
4.1 Turn your idea into commands
Choose what you want your program to do. Say the goal in plain words, such as "The car drives to the garage and beeps." Decide where it starts and where it should finish.
Draw or tell the plan
Trace a route with your finger, or draw it on a grid. For a story, sketch the actions like pictures in a comic strip. Say what happens first, next, and last.
This plan is your algorithm. You can change it before spending time snapping blocks or pressing buttons.
Break a big step into small commands
A floor robot does not have a button called "visit the garage". Look at the route and use commands it knows.
The garage is two squares ahead and one left. The robot begins facing ahead. Your plan says, "Go two squares, turn toward the garage, then go one square."
Build the code step by step:
- Two squares ahead needs
forward, forward. - Facing the garage needs
turn left. - The last square needs
forward.
Write ↑ ↑ ↰ ↑, then trace it to check. The turn is on the second square ahead, before the last move.
Plan a sprite’s story
A cat walks in, says "Hello!", then jumps. In a grid app, you could use "move right 3", "say Hello!", then "hop" after the start and reset blocks. The speech belongs between walking and hopping because that is the story you planned.
Select the character before giving it blocks. Each sprite has its own code. Get one character working before building another character’s part.
Check both the plan and the code
Lay the code next to the drawn path or story pictures. Does each planned step have commands? Are they in the right places?
If the code follows the plan but still misses the goal, check the plan too. You may have counted the route wrongly. If the plan is right and a block differs, fix the block.
More than one program can reach a goal. A shorter one is often easier to read, but it must still do every part of the job. Check the route and the finish before choosing it.
Key Takeaways
- Say the goal and choose the start before building.
- Draw a path or story plan in order.
- Break each big step into commands the robot or sprite knows.
- If the result is wrong, check the plan as well as the code.
4.2 Build a little, test a little
Testing means running your program to check that it does what you wanted. You can test before the whole program is finished. A bug is easier to find in a few new blocks than in a long untested list.
Add one small part
Build the first few commands. Predict what they do, run them, and check the result. Fix any bug before adding the next part.
For a car that should reach a garage and beep, first get the journey working. Check the stop square. Then add the beep and check that it happens after the journey. Each new part has a clear job you can test.
Let the goal guide your test
Look for every part of the goal. A robot might reach the right square but face the wrong way. A sprite might reach its place but say the wrong words. Watch and listen to the whole run.
Ask a friend to test too. Tell them the goal and let them say what they saw. Kind feedback names something that works and something to fix: "The car reaches the garage. The beep needs to come after the move."
Make code easier to read
Look for commands that undo each other. A right turn followed straight away by a left turn leaves the robot on the same square, facing the same way. If your goal only needs that route and finish, you can remove both turns.
In a grid app that allows numbers in move blocks, four "move right 1" blocks can become one "move right 4" block. The sprite reaches the same place. Check that your goal does not need separate actions between those moves.
Test again from the start after tidying. A shorter list is useful only if it still does the job.
Share what you learned
Show a partner each part of your code and say what it does. Tell them about one bug you fixed. You might say, "I counted Start as a move. Now I count only the squares the robot enters."
Use that lesson on your next program. If left and right were tricky, check from behind the robot before entering its turns. If a block was loose, check the joins as you build.
Key Takeaways
- Test a few commands before adding the next part.
- Check every part of the goal, including words, sounds, and facing.
- Use kind, clear feedback when testing with a friend.
- Remove unneeded commands or combine matching moves where the app allows it.
- After tidying, test from the start.
- Remember a bug you fixed and check for it next time.
Sequences and Debugging examples
1Give a robot and a sprite a job
18 steps
- 1IntroductionFrom an idea to a program
You want a robot to reach a toy tree. "Visit the tree" names the job, but the robot needs smaller steps. You will choose commands, put them in order, and check turns. Then you will build a short block program for a sprite on a screen.
- 2ExplanationOne command, then another
A command gives one instruction, such as "forward". A program lists commands for a robot or computer to follow. The commands are called code. In your sequence, each command has a place: the first runs before the second, and so on.
- 3AnalogyPlan the job first
Think about steps for getting ready to draw: get paper, choose a crayon, draw. A step-by-step plan is an algorithm. A program writes a plan in commands a computer knows. For the robot’s trip, you need move and turn commands instead of drawing steps.
- 4ExampleTry a swap
Put a counter on Start, facing the top. Act out
forward, turn left. It moves ahead, then faces left. Put it back and tryturn left, forward. It now moves left from Start. The same commands reach different squares because the order changed. - 5ChallengeWill these end together?
On a number track, start at 0. One program moves forward 1, then forward 4. Another moves forward 4, then forward 1. Do they end together?
---reveal---
Yes, both stop on 5. Both move five places forward. This swap keeps the total distance on the same straight track.
- 6ExplanationTurn without traveling
On your robot’s mat, forward moves one square toward its front. Backward moves behind it without turning. A left or right turn is a quarter turn on the spot. Act out a right turn: your front changes direction, but your feet stay in place.
- 7TipStand behind your robot
Use the robot’s left and right. When it faces you, its right lies on your left. Stand behind it, facing the same way. Point your right hand toward its right. This helps you choose the turn before entering the route.
- 8ExampleFirst, reach the turning square
The tree is three squares ahead and one left of Start. Your robot begins facing the top. Lay down
↑ ↑ ↑. Each arrow means forward. Count the three new squares it enters. It is now beside the tree’s row, still facing the top. - 9ExampleNow, turn toward the tree
Keep the robot at that turning square. Add
↰ ↑: turn left, then forward. The turn changes its facing without moving it. The forward enters the tree square. Your complete route is↑ ↑ ↑ ↰ ↑. On a robot that stores commands, Clear first, enter the list, and press Go. - 10ChallengeReach a toy beside Start
A robot faces the top. A toy is one square to its right. Sam enters only
↱. Where does the robot stop, and what command is missing?---reveal---
It stays on Start, now facing right. Add
↑after the turn to reach the toy. Here the forward arrow follows the robot’s new front. - 11ExplanationChoose the sprite
A sprite is a character or object on a screen. Select the sprite before dragging blocks into its code area. Its blocks control that sprite. Snap the blocks together, following your app’s order, either across the screen or down the page.
- 12ExampleStart, reset, then move
A bird should move to a nest five grid squares right of Home. Start with "when green flag clicked". Snap on a position reset to Home, then "move right 5". In this grid app, the move counts squares toward the screen’s right side.
- 13ExampleSpeak after arriving
Add "say Home!" after the move. The connected program starts, resets the bird, moves right five squares, and then shows "Home!". A speech block changes what you see. A sound block can add something you hear, such as a chirp after the speech.
- 14Key InsightReset more than place when needed
Suppose the bird grows and hides at the end of its run. Moving it home next time changes only its place. Add blocks after the start that restore its starting size and make it show. Otherwise the next test begins with a large, hidden bird.
- 15ChallengeWhy is the speech missing?
Your bird moves to the nest, but its "say Home!" block is loose beside the program. How can you make it speak after arriving?
---reveal---
Snap the speech block onto the end of the bird’s connected sequence. A loose block does not run with that sequence, even when it sits near the move.
- 16TipLet each sound finish
Some apps have both "start sound" and "play sound until done" blocks. The first begins a sound and carries on. The second waits for it to finish. For a tune whose sounds must play one after another, choose the waiting blocks so the sounds do not overlap.
- 17ChallengeCheck a fresh robot run
You wrote a new route to the tree. Your robot keeps old commands, and its front now faces left. Your plan starts facing the top. What must you set up before entering and running the new route?
---reveal---
Clear old commands. Put the robot on Start facing the top, then enter the new route and press Go. The code and the starting setup both affect the trip.
- 18RecapReady to give commands
A program turns a plan into commands the robot or sprite knows. Check their order, read what each move means, and keep turns on the same square. For blocks, select the right sprite, connect its sequence, and give each run the same starting features.
2Predict a route with a counter
11 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionRead before you run
- 2ExplanationKeep two things in mind
- 3ExampleFollow the first three commands
- 4ExampleFinish the same route
- 5ChallengeBack up after a turn
- 6ConnectionExplain the path with a reason
- 7ExampleChange the last move
- 8ChallengeCompare two paths
- 9TipUse a miss to choose what to check
- 10ChallengeChange a turn and trace again
- 11RecapCheck your prediction
3Follow the clues to a bug
14 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionWhat did you want to happen?
- 2ExplanationName the mistake
- 3ExampleRead the tent program
- 4ChallengeName a different bug
- 5ExampleWatch the tent route begin
- 6ExampleStop at the first difference
- 7TipMake each step easier to see
- 8ChallengeFind the first wrong block
- 9ExampleChange one turn
- 10ExampleRun the whole fixed program
- 11ChallengeA later bug appears
- 12Key InsightOne change tells you more
- 13ChallengeThe code never gets a chance
- 14RecapFollow the clue, then test
4Build a short sprite story
11 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionChoose a small story
- 2ExplanationGive every action a place
- 3ExampleTurn the first picture into code
- 4ChallengeKeep the story in order
- 5ExampleTest the journey first
- 6TipListen to a friend’s test
- 7ExampleJoin the matching moves
- 8ChallengeCheck after tidying
- 9ChallengeWhen the plan needs a fix
- 10ConnectionKeep a lesson from a bug
- 11RecapShow a working program
Sequences and Debugging practice questions
Set 1: Commands, turns, and first programs10 Practice Questions
Question 1 of 10
Show answerHide answer
Question 2 of 10
turn right. Where is the robot after that command?Show answerHide answer
Question 3 of 10
Show answerHide answer
Question 4 of 10
Show answerHide answer
Question 5 of 10
Show answerHide answer
Question 6 of 10
forward, turn left, backward. Where does it finish compared with Start?Show answerHide answer
Question 7 of 10
forward, turn right, forward, forward, turn left, forward. Where does it stop?Show answerHide answer
Question 8 of 10
Show answerHide answer
Question 9 of 10
Show answerHide answer
Question 10 of 10
Show answerHide answer
Set 2: Follow routes and find small bugs10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
forward, backward, and turn commands. Your plan says "visit the rug". What must you do before entering the plan?Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
backward, turn left, forward. Where is it compared with Start?Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
forward, turn right, backward, turn left, forward. What are its final place and facing?Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
forward, forward, forward. What bug makes it pass the leaf?Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
forward, turn left, forward. The robot starts correctly but runs forward, forward, turn left. At which command does it first differ from the plan?Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 3: Debugging clues and careful retests10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
forward, forward, turn right, backward, turn right, forward. Where does it end compared with Start?Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
forward, turn left, turn right, forward. The other runs forward, forward. How do their finish places and facings compare?Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 4: Make programs work from start to finish10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
forward, turn right, forward, turn left, backward. Where does it finish and face?Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
forward, turn right, forward, turn left, forward. You change only the first turn to turn left. Where will it now stop?Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
turn right, forward, forward. What kind of bug is in this list?Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
forward, turn left, turn right, forward, turn right, forward. What shorter code keeps that path and facing?Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Stuck on your own question? Homework Help
Key Terms
A
Algorithm
B
Backward
Block
Bug
Build in small parts
C
Clear
Code
Coding
Command
D
Debugging
E
Extra command
F
Facing
Feedback
First wrong step
Floor robot
Forward
G
Go
Goal
L
Logical reasoning
Looks block
M
Missing command
Motion block
P
Part test
Plan
Prediction
Program
Q
Quarter turn
R
Reset
Retest
Route
S
Sequence
Sound block
Sprite
Start block
Step through
Story plan
T
Target
Testing
Tidy code
Trace
U
Undoing turns
W
Wait block
Wrong command
Wrong number
Wrong order
About this lesson
Make your own Study Materials
Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.