🚀 Quick Study Guide: Greater Than/Less Than in Scratch
- 🔍 The 'greater than' ($>$), 'less than' ($<$) and 'equal to' ($=$) blocks are found in the Operators category in Scratch.
- ✅ These blocks are Boolean operators, meaning they always return either true or false.
- ⚙️ They are typically used inside conditional statements like 'if...then' or 'if...then...else' blocks to control the flow of a script.
- 📈 The 'greater than' block checks if the value on its left is larger than the value on its right. For example, $(10 > 5)$ is true, while $(5 > 10)$ is false.
- 📉 The 'less than' block checks if the value on its left is smaller than the value on its right. For example, $(3 < 7)$ is true, while $(7 < 3)$ is false.
- ⚖️ The 'equal to' block checks if two values are identical. For example, $(5 = 5)$ is true, while $(5 = 7)$ is false.
- ✨ These operators are crucial for creating interactive sprites, scoring systems, boundary detection, and game logic.
🧠 Practice Quiz: Scratch Operators
- 1. If a Scratch script contains the block $(score > 100)$ and the current value of the variable 'score' is 95, what value will this block return?
- A. 95
- B. 100
- C. true
- D. false
- 2. Which Scratch block would you use to check if a sprite's 'x position' is to the left of the center of the stage (where x-position is 0)?
- A. $(x\ position = 0)$
- B. $(x\ position > 0)$
- C. $(x\ position < 0)$
- D. $(x\ position \ge 0)$
- 3. In Scratch, where can you find the 'greater than' and 'less than' blocks?
- A. Motion
- B. Looks
- C. Operators
- D. Control
- 4. A game needs to stop when the 'lives' variable drops to 0. Which condition would be most suitable for an 'if...then' block to check for game over?
- A. $(lives > 0)$
- B. $(lives < 0)$
- C. $(lives = 0)$
- D. $(lives \ne 0)$
- 5. What is the output of the Scratch block $(5 * 2 < 10 + 1)$?
- A. true
- B. false
- C. 10
- D. 11
- 6. You want a sprite to say "Too high!" if its 'y position' is above 150. Which operator would you use in the condition?
- A. Equal to $(=)$
- B. Less than $(<)$
- C. Greater than $(>)$
- D. Not equal to $(\ne)$
- 7. Consider the expression $(A < B)$ in Scratch. If $A = 20$ and $B = 15$, what will this expression evaluate to?
- A. true
- B. false
- C. 20
- D. 15
Click to see Answers
1. D. false
2. C. $(x\ position < 0)$
3. C. Operators
4. C. $(lives = 0)$
5. A. true (Because $5 * 2 = 10$, and $10 + 1 = 11$. So $(10 < 11)$ is true.)
6. C. Greater than $(>)$
7. B. false (Because $20 < 15$ is false.)