stoneskin

learning coding with Scratch , Python and Java

5 More conditions

5.1 Boolean Type

In computer science, the Boolean data type is a data type that has one of two possible values which is intended to represent the two truth values of logic and Boolean algebra.

true false

5.2 Scratch Boolean blocks

There sre some base boolean blocks in scratch you already know how to use

boolean

5.3 Boolean operation blocks

Below is the boolean operation blocks and or not and or not

5.3.1 And

for And block, must be both side is true, the block value is true:

and

We could make note of above blocks as express:

  (55 > 50) And (56 > 50) => (True) And (True) = True
  (55 > 50) And (49 > 50) => (True) And (False) = False
  (45 > 50) And (49 > 50) => (False) And (False) =False

5.3.2 Or

For the OR, any one side is true, the block value is true

or

 (55 > 50) OR (56 > 50) => True OR True = True
 (55 > 50) OR (49 > 50) => True OR False = False
 (45 > 50) OR (49 > 50) => False OR False = False

5.3.3 Not

For the Not, it will reverse the value, if Not(True) = False

not

Not (55 > 50) => Not True = False
Not (45 > 50) => Not False = True

5.4 Boolean Practice project

5.5 example of Boolean

Shark demo https://scratch.mit.edu/projects/432203048