NEW Explore the Scratch Block Dictionary, tutorials, textbook, and classroom guides

Start learning →

Chapter 10: Logical Operators (AND, OR, NOT)

📌 What you will learn

Combine multiple conditions cleanly to handle ranges, dual controls (WASD + Arrows), and key-release waits.

Lesson goal & core concept

Build compound rules without messy nested "if" blocks.

AND needs both sides true; OR needs at least one side true; NOT flips true to false and false to true.

INTERACTIVE LAB

Scratch Logic Gate Explorer (AND / OR / NOT)

Toggle Condition A and Condition B to see live true/false results for Scratch AND, OR, and NOT boolean blocks.

<A> and <B> FALSE
<A> or <B> TRUE
not <A> FALSE

Step-by-step practice

Work through these steps in the Scratch editor, predicting each result before clicking the green flag.

  • Use OR to accept both Right Arrow and D key.
  • Use AND to check both touching Door AND has_key = 1.
  • Use NOT inside "wait until <not <key space pressed?>>" to prevent spam jumps.
  • Evaluate inner hexagons first when reading nested logic.
Chapter 10: Logical Operators (AND, OR, NOT) — Example
  1. When green flag clicked
  2. Forever
  3. If <key (right arrow) pressed? or key (d) pressed?> then
  4. Change x by 6

Try it: Supports both arrow keys and WASD seamlessly.

Mini challenge & next steps

Create an S-Rank check requiring BOTH score >= 100 AND misses = 0.

Scratch Learning Textbook Home Return to the full 4-stage curriculum overview. Learn more → Scratch Block Dictionary Look up any block used in this chapter. Learn more →

FAQ

How long should I spend on "Chapter 10: Logical Operators (AND, OR, NOT)"?

Aim for 15–20 minutes: read the concept, test the small example, modify one value to see what changes, and try the mini challenge.

This guide is provided for educational purposes. Scratch screens and terms may change over time, so please check the official Scratch website as well.