Computers & Coding

Sequences, loops, if/then, block coding and staying safe online

Skills

  • Algorithms and sequences
  • Loops and repeat counts
  • If/then — conditionals
  • Debugging
  • Block coding — ScratchJr and Scratch
  • How messages travel on the internet
  • Strong passwords
  • Kindness online and asking before sharing

Lessons

Algorithms and sequences

An algorithm is a set of step-by-step instructions for doing a task. The sequence is the order of the steps. If the steps are in the wrong order, the task won't work the way you want. Examples: 🦷 Brushing teeth: 1. Wet brush → 2. Add toothpaste → 3. Brush → 4. Rinse; ❌ Brush first, then add toothpaste → the order is wrong!; 🤖 Robot game: 'Step forward, step forward, turn left' → the robot follows exactly. Tip: Write the steps for making a snack, then ask a grown-up to follow them exactly like a robot!

Loops and repeat counts

A loop tells the computer to repeat steps instead of writing them again and again. The repeat count says how many times to do it. Loops make code shorter and easier to read. Examples: 🟦 Draw a square: repeat 4 times → move forward, turn right; 👏 'Clap, clap, clap, clap, clap' → repeat 5 times: clap; 🐸 Jump 3 times → repeat 3: jump (instead of jump, jump, jump). Tip: When you see the same steps over and over, ask yourself: can a loop do this?

If/then — conditionals

A conditional lets a program make a choice. It checks if something is true, and then it does an action only when it is. You use conditionals every day without thinking about it! Examples: ☔ If it is raining, then take an umbrella; 🍽️ If my plate is empty, then I can have a fruit snack; 🎮 If the cat touches the fish, then add 1 point. Tip: Play a game: 'If I clap, then you jump!' and take turns making new rules.

Debugging

A bug is a mistake in code that makes a program do something you didn't expect. Debugging means finding and fixing the bug. Coders go through the steps one at a time to find where things went wrong. Examples: 🤖 The robot should go to the star but hits the wall → it turned left instead of right → fix that step; 🔍 Read each step out loud and act it out to find the bug; 🔁 Fix one thing, then test again. Tip: Every coder makes bugs, so finding one means you're learning!

Block coding — ScratchJr and Scratch

In ScratchJr and Scratch, you code by snapping blocks together like puzzle pieces instead of typing words. Each block is one instruction for a character, called a sprite. Blocks run from top to bottom (or left to right in ScratchJr), so their order matters. Examples: 🟩 When green flag clicked → move 10 steps → say 'Hello!'; 🔁 Snap a repeat block around 'move' to make the sprite walk far; 🐱 Change the order of the blocks → the sprite does things in a new order. Tip: Ask a grown-up to help you try block coding and make a sprite dance!

How messages travel on the internet

The internet is a giant network of computers connected together. When you send a message, it is broken into small pieces called packets. The packets travel through the network, sometimes by different paths, and are put back together in order when they arrive. Examples: ✉️ 'See you at recess!' → split into packets → travel → rebuilt on the other computer; 📦📦📦 Each packet is numbered so it can be put back in the right order; 🧩 Like mailing a puzzle in 3 envelopes and rebuilding it at the other end. Tip: Act it out: write a message on 3 cards, number them, mix them up and put them back in order!

Strong passwords

A password is like a secret key that keeps your account locked. Strong passwords are long and hard to guess, mixing letters, numbers and symbols, or using a silly phrase of several words. Keep your password secret and only share it with your parent or guardian. Examples: ❌ Weak: 'password' or '1234' → too easy to guess; ❌ Weak: your name or your pet's name; ✅ Strong idea: three or four random words joined together, plus a number and a symbol — make up your own!. Tip: Never tell your password to friends, even best friends; only a parent or guardian should know it.

Kindness online and asking before sharing

Real people read what you write online, so use the same kind words you would use face to face. Always ask a grown-up before you post or share anything. Ask friends before sharing a photo of them, too. Examples: 💬 Before you type, ask: is it true, is it kind, is it helpful?; 📸 Want to share a picture of your friend → ask your friend and a grown-up first; 😟 Someone writes something mean → don't reply; show a trusted adult. Tip: If you wouldn't say it to someone's face, don't type it online.

For parents