Skip to main content
โ† Back to Traditional Coding samples
โŒจ๏ธTraditional Codingยท15 minยทSample Lesson

Computers Follow Instructions: Your First Coding Adventure

Did you know that a computer will do EXACTLY what you tell it โ€” even if you make a mistake? If you tell a robot to put on your shoes before your socks, it will! Computers follow instructions in order, one by one. That list of instructions is called CODE.

What You'll Learn

In this lesson you will: - Learn what code is (a list of instructions for a computer) - Find out why ORDER matters in coding - Meet the three most important coding words: sequence, loop, and bug - Write your very first mini-code using arrows

What Is Code?

Code is a list of steps a computer follows to do a job. Computers cannot guess what you want. They only do EXACTLY what the code says. Think of making a peanut butter sandwich: Step 1: Get two slices of bread. Step 2: Open the peanut butter jar. Step 3: Spread peanut butter on one slice. Step 4: Put the other slice on top. If you did Step 4 first, you would have empty bread! Order matters. Code works the same way.

Coding Fun Fact

The first computer program was written by Ada Lovelace in 1843 โ€” before computers were even built! She figured out how to write instructions for a machine that did not exist yet. She is called the world's first programmer.

Sequence, Loop, and Bug

Sequence means doing things ONE at a time, IN ORDER. Most code is a sequence. Loop means doing something AGAIN AND AGAIN. 'Brush each tooth' is a loop โ€” you do it over and over until every tooth is clean. Bug means a MISTAKE in the code. When your code does something wrong or unexpected, there is a bug. Fixing bugs is called debugging. Every programmer debugs โ€” even the best ones!

What to Do When Code Goes Wrong

Do not give up! Read your instructions from the very beginning, one step at a time. Find the first step that goes wrong โ€” that is your bug. Change it and try again. This is exactly what real programmers do every day.

Arrow Code: Move the Robot!

Let us write code using arrows. Imagine a robot standing on a grid. You can give it these commands: U = move Up D = move Down L = move Left R = move Right Example: Make the robot walk to a star two squares to the right and one square up. Code: R, R, U The robot follows each arrow one at a time. If you wrote U, R, R instead, the robot goes up first โ€” and reaches a different spot. Order always matters!

Match each coding word to what it means.

Terms

Sequence
Loop
Bug
Debugging

Definitions

Steps done one at a time, in order
Finding and fixing a mistake
A mistake in the code
Doing the same thing again and again

Drag terms onto their definitions, or click a term then click a definition to match.

โ“

You tell a robot: Go Right, Go Right, Pick up ball. But the ball is one square UP and two squares RIGHT. What went wrong?

โ“

Which of these is an example of a LOOP?

๐ŸŽฏ

Program a Friend Robot

1. Pick a partner (a friend, sibling, or stuffed animal standing in as a 'robot'). 2. Place three objects in different spots in the room (like a book, a cup, and a toy). 3. Write arrow code on paper to get your 'robot' from their starting spot to the book. Use: U (step forward), D (step back), L (turn left one step), R (turn right one step). 4. Read your code aloud one step at a time while your partner follows EXACTLY what you say. 5. Did they reach the book? If not, find the bug and fix your code! Deliverable: Your written arrow code, and the corrected version if you found a bug.

Flashcards โ€” click each card to reveal the answer

Want to keep learning?

Sign up for free to access the full curriculum โ€” all subjects, all ages.

Start Learning Free
Computers Follow Instructions: Your First Coding Adventure | Free Sample | HYVE CARES | HYVE CARES