MoonCampaign by Viaan (8 years)
Our Social Impact - We're transforming education globally with free robotics and math workshops in the US, UK,
Canada, and Australia.
Our workshops have helped 66,000 students alone in the US plus 14,000 students benefit from our four-week sessions.
Or Block
Show and Tell
Show n Tell
Coming Soon
Viaan’s project demonstrates the ""Or"" operator by creating a program that compares two conditions for interactivity. When either of the variables, Christmas or New Year, is true, the Micro:bit displays a smiley face. If neither is true, a sad face is shown instead. This highlights how logical operators enable intuitive decision-making in programming and user-focused applications.
The "Or" logical operator is a fascinating tool that compares two or more conditions to determine if at least one of them is true. If any condition is met, the program enters the "If" block and performs a specific action. If none of the conditions are true, it moves to the "Else" block and executes a different action.
For my project, I used the "Or" operator to create a simple yet fun program. I defined two variables, Christmas and New Year, assigning them 0 (False) and 1 (True), respectively. If either of the variables evaluates to True (or both do), the code displays a Smiley face. However, if neither is true, a Sad face appears instead.
This project was a great way to understand and demonstrate the functionality of the "Or" operator. It’s incredible how a basic programming concept can be used to create interactive and intuitive programs that are easy to build and enjoyable to see in action.
©️ Copyright, Moonpreneur Inc.
691 S Milpitas Blvd, STE 217 Milpitas CA 95035, USA
Likes
Rating
43 days left
Or Block