Programming L4
Programming L4
1
LESSON OBJECTIVE: In this lesson, you will design programming structures using logical and relational
operators.
Grade: 7.4
Describe and use the following symbols: AND, OR, NOT, >, <,
=.
K
N
O
Grade: 7.5
W
AP
LE
EVALUATIO
PL
E
the programming of games.
A NA
AT
I ON
LYSI
2
Silent Starter
This lesson you will be using operator blocks.
Drag and drop the correct description next to the correct operator.
4
Operator blocks
Using logical operators, you can combine two or
more relational operators to produce a single true/false
result. Using these blocks allow you to further refine your
comparison of values.
There are 3 logic
operators:
•And
•Or
•Not
5
Task 1a – Explain the code
Answer…
6
Task 1b – Explain the code
Answer…
7
Task 1c – Explain the code
Answer…
8
Task 1d – Explain the code
Answer…
9
Task 1e – Explain the code
Answer…
10
Task 1f - Explain the code
Answer…
11
Task 2: Viewing a game
Click on the following link below:
https://scratch.mit.edu/projects/112
41535/editor/
16
Task 3: Creating a
game
10. We only give the player a single
chance to guess the number. We really
need to give the player more chances.
17
Task 3: Creating a
game
11. Let’s keep count of how many guesses they take
before they reach the correct number. Add a new
variable called ‘Guesses’:
18
Task 3: Creating a
game
13. Now we want to stop the game if the player
picks the correct number, so add the ‘Stop All’
block inside the equals if block section.
19
Task 3: Creating a
game
14. Next, we need to tell the player
that they need to pick another
number, so ask them to try again.
20
Task 3: Creating a
game
15. We need to give our players some reward
for picking the correct number. This could be
a cheering sound or maybe it could be some
really cool visual trick.
21
Task 3: Creating a
game
16. Finally, we need to hide our ‘NumberToGuess’ variable so it
doesn’t appear on the stage.
17. You can now test your game and make sure it is working.
22
Task 3 – Guessing Game Evidence
23
Show an understanding of the advanced
Extension 1 mathematical operators MOD, ROUND and
the drop down operators.
Plenary
Define logical operators and give three examples of
logical operators:
n e !
o n Do
Less
27