Computer Science Grade 2 20 min

The Mixed-Up Story

Putting a jumbled story back in the correct order.

Tutorial Preview

1

Introduction & Learning Objectives

Learning Objectives Identify a 'bug' in a short sequence of code blocks. Explain what a bug is using a simple story. Use a step-by-step method to find a mistake. Fix a bug by changing or moving a single code block. Predict what a program will do with a bug in it. Correct the number in a simple loop block. What if you tried to brush your teeth with a banana? 🍌 That sounds silly, right? We will learn how to find silly mistakes in computer stories. This is called debugging! It helps us fix our code so it works perfectly. ✨ Real-World Applications Fixing the order of steps when building a LEGO tower. Finding the wrong ingredient in a cookie recipe. Figuring out why a video game character won't jump. Putting puzzle pieces in the right spot.
2

Key Concepts & Vocabulary

TermDefinitionExample Bug 🐛A bug is a mistake in the code. It makes the story or game act silly.Telling a robot to walk into a wall is a bug. Debugging 🕵️Debugging is finding and fixing bugs. You are a code detective!You see the robot walking to the wall. You change 'walk' to 'turn'. Code Blocks 🧱Code blocks are the instructions for the computer. Each block is one step.A 'move forward' block tells a character to take one step. Sequence ➡️A sequence is the order of the code blocks. Order is very important!1. Pick up cup. 2. Pour juice. 3. Drink. This is a good sequence. Loop 🔁A loop tells the computer to do something over and over again.A 'Repeat 3 times: Clap' block makes a character clap three times.
3

Core Syntax & Patterns

The One-Step-at-a-Time Rule Read each code block one by one, in order. Use this to carefully follow the computer's steps. It helps you find exactly where the story gets mixed up. The Test and See Rule Change one thing, then run the code to see what happens. Don't change everything at once! Make one fix and test it. This shows if your fix worked. The Talk-It-Out Rule Say the steps out loud to yourself or a friend. Sometimes, hearing the story helps you find the silly part. It's like reading a book out loud.

4 more steps in this tutorial

Sign up free to access the complete tutorial with worked examples and practice.

Sign Up Free to Continue

Sample Practice Questions

Challenging
Code: `1. Set background to DAY. 2. LOOP 3 times { Character jumps. } 3. Set background to NIGHT.` In the story, the background stays DAY the whole time and never turns to NIGHT. What is the most likely problem?
A.The loop is repeating too many times.
B.The 'Set background to NIGHT' block is missing or broken.
C.The character is jumping too high.
D.The 'Set background to DAY' block is wrong.
Challenging
A cat should hide ONLY IF it is raining. In the story, the cat hides even when it's sunny. What kind of block is probably broken or being used incorrectly?
A.'Loop' block
B.'Move' block
C.An 'If...Then' block
D.'Start' block
Challenging
The code has a loop inside another loop: `LOOP 2 times { Say 'Hello'. LOOP 3 times { Clap. } }` How many times will the character clap in total?
A.2 times
B.3 times
C.5 times
D.6 times

Want to practice and check your answers?

Sign up to access all questions with instant feedback, explanations, and progress tracking.

Start Practicing Free

More from Finding the Missing Piece: Introduction to Debugging

Ready to find your learning gaps?

Take a free diagnostic test and get a personalized learning plan in minutes.