Intro to Block Coding

Block coding is a way to give a computer instructions by snapping together colorful puzzle-like pieces instead of typing letters and symbols.

Reading is good — doing is better. Practice Intro to block coding as an interactive lesson.

Try the lesson

Definition

Block coding is a type of computer programming where you build instructions for a computer by clicking and dragging colorful blocks that snap together like puzzle pieces. Each block is a command that tells the computer to do one thing, such as move forward, play a sound, or repeat an action. When you connect blocks in order, the computer follows them step by step. This lets kids learn how programs work without needing to memorize complicated text.

Remember the rule

One block = one step. Put blocks in order, and the computer follows them top to bottom — every single time.

Key words

Block
A single colorful puzzle piece that gives the computer one instruction, like 'move 10 steps.'
Code
A set of instructions that tells a computer exactly what to do.
Program
A complete set of blocks connected together that makes something happen on the screen.
Sequence
The order in which blocks are placed — the computer reads them from top to bottom, one at a time.
Loop
A special block that makes the computer repeat a group of instructions a set number of times.
Event
A block that starts your program, like 'When the green flag is clicked.'
Sprite
A character or object on the screen that your blocks control.
Debug
Finding and fixing a mistake in your code so the program works correctly.

Worked examples

You want a cat sprite to move across the screen. Which blocks do you use?

Snap together: [When green flag clicked] → [Move 100 steps]. Click the green flag and the cat walks forward 100 steps. · The event block always goes first so the computer knows when to start.

You want the cat to say 'Hello!' after it moves. How do you add that?

Add a [Say Hello! for 2 seconds] block below the [Move 100 steps] block. Now the cat moves first, then speaks. · Sequence matters — the computer does the top block first, then goes down.

You want the cat to move 10 steps five times in a row. Is there an easier way than placing five move blocks?

Use a [Repeat 5] loop block and put [Move 10 steps] inside it. The computer runs the move block 5 times automatically. · Loops save time and keep your code short and neat.

You run your program but the sprite goes the wrong direction. What do you do?

Debug it! Check your blocks — add a [Turn 90 degrees] block before the move block to point the sprite the right way, then run it again. · Debugging means fixing mistakes, and every programmer does it.

You want a sprite to make a sound when you press the spacebar. How do you set that up?

Use [When space key pressed] as your event block, then snap [Play sound meow] below it. Press spacebar and the sound plays. · Changing the event block changes what triggers your program.

Common mistakes

  • Putting blocks in the wrong order — for example, placing the 'Say' block before the 'Move' block when you want the sprite to move first.
  • Forgetting to start with an event block like 'When green flag clicked,' so the program never runs at all.
  • Dropping a block next to the stack instead of snapping it onto the bottom, so the computer ignores the disconnected block.
  • Using a repeat loop but forgetting to put the action block inside the loop, so nothing repeats.
  • Giving up after one try when something goes wrong — debugging is a normal part of coding, not a sign of failure.

FAQs

Why do we use blocks instead of typing real code?

Blocks let you focus on learning how programs work — sequences, loops, and events — without worrying about spelling every command perfectly. Many professional tools use the same ideas, just written differently.

Does the order of the blocks really matter?

Yes, always! The computer reads blocks from top to bottom, one at a time. If you put them in the wrong order, the program does things in the wrong order.

What happens if two blocks don't snap together?

It means they are not meant to connect. For example, you cannot put a loop block inside a motion block. Try a different spot or a different block.

Can I make a mistake and break the computer?

No! Block coding programs are completely safe to experiment with. If something goes wrong, just move the blocks around and try again.

What is the green flag for?

The green flag is the most common event block. Clicking it tells the computer 'Start the program now!' It is like pressing Play on a video.

Is block coding real coding?

Yes! Block coding teaches the exact same ideas that real programmers use: sequences, loops, and events. Many kids who start with blocks later move on to text coding languages like Python.

Want the whole picture for your child?

Every K–6 subject, an AI tutor that teaches step by step, unlimited practice, and a reward world.

Start a 3-day free trial

Related concepts (3rd Grade Technology)