Puzzle 1 – guessing a number

Step 3 – higher or lower

The third part of the Scratch program deals with telling the player whether the guess is higher or lower.

Scratch code image

This uses IF blocks. These are an example of selection in the program – choosing what to do next.

IMPORTANT: be really careful with your indents in code here. Keep them level with any other code at the same indent level.

  1. Add an IF line to check if the answer (the guess) is greater than (the > symbol) the number
  2. Then use a print statement to tell the user – use the Scratch code to figure out what to say
  3. Then do the same thing if the answer (the guess) is less than the number
  4. Save your program and then run it. It should pretty much run properly now.

Code helper image