Hello Readers!
Are you thinking of doing some exciting new project on Scratch?
You have some great new ideas and you sit to start working on the project but oops! You realize that you are totally confused about using blocks from scratch.
No worries! We got your back. By the end of this article, you will have a detailed understanding of one of the essential blocks of scratch – ‘LOGICAL STATEMENTS’. Keep reading until the very end and you’ll never be stuck again on this topic. Let’s begin from scratch!
Before starting with types of logical statements in Scratch programming, let’s get a brief understanding of Scratch.
Scratch is a visual programming language that allows its users to create their own interactive stories, games, and animations.
When we use two simple statements within a logical connective we form a complex conditional statement and that statement evaluates if one or the other conditions are met.
But what do we understand by the term “Logical Statements”? A statement is true if what it asserts is the case, and it is false if what it asserts is not the case.
Such a statement that is either true or false defines logical statements.
With the help of logical operators, we can combine two or more operators to make a logical outcome and produce a single output that can be true or false.
These blocks allow us to further refine our comparison of values.
THERE ARE THREE LOGICAL STATEMENTS IN SCRATCH
- AND
- OR
- NOT
THESE LOGICAL STATEMENTS IN SCRATCH ARE THE PRIMARY FOUNDATION FOR CONNECTIVES IN CONDITIONAL STATEMENTS.
To know where these blocks can be found, just look towards the right-hand side of your scratch screen and you’ll be able to locate them in the operator’s tab which is in green color.
Since we have a basic familiarity with what is scratch and the types of Scratch operators. Let’s dive deeper into the subject by understanding all these individual components in detail.
- AND: The ‘and’ operator is only true if both the statements in the ‘and’ block result as true. It takes two expressions as parameters if both expressions are true then the block runs as true otherwise, it returns as false. In some research studies, it was found that the logical operator ‘and’ was used as the sole logical connective between multiple simple statements in a conditional statement. It was observed that students are able to successfully learn how two statements, linked together by a logical connective, will only occur in a formal language (such as Scratch) when each statement assesses true and the consequent result, the logical connective ‘and’, combines these statements to make the Complex Conditional Statement ‘true’. In simpler words, It is important to realize that the command will only get executed if both sides of the block are satisfied.
- OR: Just like the operator ‘and’, ‘or’ operator uses two parameters as well but in this case, both the statements need not be true. If either of the statement is true the ‘or’ operator runs true. It results in false only if both the statements are false. While coding this block you should keep in mind that only one side of the operator has to be true in order for the code to execute.
- NOT: Unlike ‘and’ & ‘or’ operators, this operator takes only one statement as the input. The result of the operator is true if the given expression is false and false if the given expression is true. we should realize while coding the ‘not’ logical statement that this code will only run if the taken comparison happens to be false. Hey, don’t stress too much! In simpler words just know that with this block – false is true and true is false.
Conclusion
Wasn’t that quick and easy to understand! Now you’ll never be stuck again while dealing with logical statements in Scratch in your further projects.
We learned about types of logical statements in Scratch and the conditions they hold. Just remember these pointers by heart and you’ll be good to go!
Until then, Keep Coding Keep Scratching!