Computer Science
Grade 2
20 min
The Out-of-Place Shape
Identifying the shape that doesn't belong in a pattern.
Tutorial Preview
1
Introduction & Learning Objectives
Learning Objectives
Identify a 'bug' in a simple pattern.
Describe a simple sequence of shapes or actions.
Explain why a shape is out of place.
Use step-by-step thinking to find an error.
Predict the correct shape in a pattern.
Look at this line of toys: π§Έπ§Έππ§Έ. Which toy doesn't belong? Let's find out why!
We will learn how to find mistakes in patterns. These mistakes are called 'bugs' π. Finding and fixing bugs is called debugging!
Real-World Applications
Fixing a LEGO tower that keeps falling over.
Finding the wrong ingredient in a cookie recipe.
Figuring out why a dance move looks silly.
Putting story pictures in the right order.
2
Key Concepts & Vocabulary
TermDefinitionExample
Bug πA bug is a mistake in a set of instructions or a pattern.In a pattern of red apples πππ, a yellow banana π is a bug.
Debug π΅οΈTo debug means to find and fix a bug.You see π΅π΅π’π΅. You debug by changing the green circle π’ to a blue one π΅.
Pattern β¨A pattern is something that repeats over and over again.Dog πΆ, Cat π±, Dog πΆ, Cat π±... is a pattern.
Sequence β‘οΈA sequence is a list of steps that happen in a specific order.1. Wake up. 2. Brush teeth. 3. Eat breakfast. This is your morning sequence.
Code Block π§±A code block is one instruction for the computer to follow.A 'Move Forward' block tells a character to take one step forward.
3
Core Syntax & Patterns
The 3 Steps of Debugging
1. Look for the pattern. 2. Check each piece. 3. Find the one that's different.
Use these steps whenever you think there is a mistake or a bug.
Say the Pattern Out Loud
Saying the pattern helps your brain find the part that sounds wrong.
When you see 'Circle, Square, Circle, Circle', saying it helps you hear the bug.
Check One Block at a Time
Look at the first block, then the second, then the third. Don't skip any!
Use this rule to carefully check a sequence of code blocks for bugs.
4 more steps in this tutorial
Sign up free to access the complete tutorial with worked examples and practice.
Sign Up Free to ContinueSample Practice Questions
Challenging
A robot is programmed to draw a pattern: Circle, Square, Circle, Square. The code is: `Loop 2 times: [Draw Circle, Draw Square]`. The result is: βͺπ₯βͺπ₯. This is correct. If the code was changed to `Loop 2 times: [Loop 2 times: [Draw Circle]]`, what would be the 'out-of-place shapes'?
A.There would be no shapes
B.Two extra circles and no squares
C.Two extra squares and no circles
D.The pattern would be correct
Challenging
A game character needs to collect 3 coins πͺ and then open a door πͺ. The code is: 1. Collect Coin. 2. Open Door. 3. Collect Coin. 4. Collect Coin. The character tries to open the door too early. This 'Open Door' action is the 'out-of-place shape'. Where should the 'Open Door' block be moved to fix the bug?
A.To the very beginning (before step 1)
B.Between step 3 and 4
C.It should be removed completely
D.To the very end (after step 4)
Challenging
A robot plants a garden using this code: `Repeat 3 times: [Plant a π», Move Forward]`. The garden should look like: π» β π» β π». But it looks like: π»π»π» (all in one spot). The robot didn't move. What is the bug?
A.The 'Move Forward' block is inside the loop but is not working
B.The 'Plant a π»' block is broken
C.The loop repeated too many times
D.The 'Move Forward' block should be outside the loop
Want to practice and check your answers?
Sign up to access all questions with instant feedback, explanations, and progress tracking.
Start Practicing Free