Step 3 – higher or lower
The third part of the Scratch program deals with telling the player whether the guess is higher or lower.
This uses IF blocks.
THEORY: IF blocks are an example of selection. Selection is choosing what to do next in a program.
IMPORTANT: be really careful with your indents in code here. Keep them level with any other code at the same indent level.
- Add an IF line to check if the answer (the guess) is greater than (the > symbol) the number
- Then use a print statement to tell the user – use the Scratch code to figure out what to say
- Then do the same thing if the answer (the guess) is less than the number
- Save your program and then run it. It should pretty much run properly now.