Class 6 - Coding, AI & Robotics Course
-
Coding
Session 1: Introduction to Coding3 Topics -
Session 2: Backdrop, Costume, and Animation3 Topics|1 Quiz
-
Session 3: Basics of Algorithm and Flowchart3 Topics|1 Quiz
-
Session 4: Basics of Pseudocode3 Topics|1 Quiz
-
Session 5: Getting Started with Quarky3 Topics|1 Quiz
-
Session 6: Variables: The Multitaskers4 Topics|1 Quiz
-
Session 7: Arithmetic Operators4 Topics|1 Quiz
-
Session 8: Conditional Statements3 Topics|1 Quiz
-
Session 9: Logical Operators4 Topics|1 Quiz
-
Session 10: Nested Conditional Statements2 Topics|1 Quiz
-
Session 11: Loops3 Topics|1 Quiz
-
Session 12: Touch Based Piano2 Topics
-
Session 13: Criterial in Loops5 Topics|1 Quiz
-
Session 14: Catch the Fruit Game - Part 12 Topics
-
Session 15: Catch the Fruit Game - Part 22 Topics|1 Quiz
-
Artificial IntelligenceSection 16: Introduction to Artificial Intelligence3 Topics|1 Quiz
-
Session 17: Basics of Face Detection2 Topics|1 Quiz
-
Session 18: Face Expression Detection2 Topics|1 Quiz
-
Session 19: Mimic Face with Quarky1 Topic
-
Session 20: Face Filter - Part 12 Topics
-
Session 21: Face Filter - Part 22 Topics
-
RoboticsSession 22: Basics of Robotics2 Topics|1 Quiz
-
Session 23: Wirelessly Controlled Robot2 Topics
-
Session 24: Introduction to Sensors3 Topics|1 Quiz
-
Session 25: Introduction to Actuators3 Topics|1 Quiz
-
Session 26: Face Tracking with Robot2 Topics
-
Session 27: Obstacle Avoidance Robot - Part 13 Topics
-
Session 28: Obstacle Avoidance Robot - Part 22 Topics|1 Quiz
-
Session 29: Edge Detector Robot - Part 13 Topics
-
Session 30: Edge Detector Robot - Part 22 Topics|1 Quiz
-
Capstone ProjectCapstone Project
OR Operator
The OR operator is used to determine if either one of two or more conditions is TRUE. If any of the condition is true, the OR operator returns TRUE. If all the conditions fail, the OR operator simply returns FALSE.
In some programming languages OR operator is denoted by “||” symbol.
Real-Life Example
We should carry an umbrella when either it is sunny, or it is raining. Otherwise, we should not carry it.
Like the previous example, if we want to derive the logical operation from this scenario, we have the following conditions:
- Condition 1: Is it sunny outside?
- Condition 2: Is it raining outside?
And the decision we are deriving is: Decision: Should we carry an umbrella?
Pseudocode
Based on this we can write the below pseudo-code:
IF (It is sunny outside) OR (It is raining outside) THEN Carry an umbrella ELSE Do not carry an umbrella END
Truth Table
Let us now try to see the different combinations possible with the above pseudo-code.
[table id=2 /]
OR Block in PictoBlox
The () or () (logical OR) block is an Operators block and a Boolean block. The block joins two Boolean blocks and compares them. If at least one of them is true, the block returns true; if neither of them is true, only then does the block return false. This block is used for checking if any of the conditions are true.
Activity: OR with Quarky
Let’s use this block with Quarky.
We are making a code that basically detects whether any of the buttons of Quarky are pressed or not. If any of the buttons is pressed then the display of Quarky will show green, otherwise red.
Assignment
Before you move on to the next lesson, a small assignment awaits you!
You must upload the PictoBlox program you created in this activity to the website. Submitting the assignment is a must in order to receive the certificate after completing the course.
Follow the steps below to upload your assignment:
- Click on Browse.
- Search and Select your saved Project file(.sb3) and Click Open.
- Click on Upload to submit the assignment.
Good luck!