← Home BP Β· 7-9 🏰

Opposite Potion

66
Day 1 πŸ”₯
🎯 Today's Missions
πŸ¦„ ⭐ πŸ§ͺ ✨
πŸ§ͺ
Magic Castle Universe
Opposite Potion
Deep in the Magic Castle's potion cabinet sits a bottle labeled OPPOSITE POTION β€” one drop flips ANY rule upside-down! TRUE becomes FALSE. FALSE becomes TRUE. Today you learn the coder's opposite-day spell: the NOT operator. It turns any check into its exact reverse β€” and it's how programs say "the opposite of this"!

🏰 What we're MAKING today: My Opposite Potion

In Logic Boss you combined TWO true/false checks with AND and OR. Today you get the third magic ingredient: NOT β€” the opposite operator! πŸͺ„

What is NOT? It's a tiny symbol β€” ! β€” that you put in front of any check to flip its answer. If the check says TRUE, ! makes it FALSE. If it says FALSE, ! makes it TRUE. It's Opposite Day for computers! Real apps use it everywhere: "send the alarm when the door is NOT locked", "show the button when the player is NOT logged in". One tiny ! β€” total flip!

πŸ”— Last time you wrote if (key AND boss) to combine two checks. Today: !(moon === "full") β€” one drop of NOT turns a TRUE rule into a FALSE rule and back again. The AND/OR gates made decisions β€” NOT makes them think the OPPOSITE! πŸ§ͺ
● ● ● potion-rule.js JavaScript

    
πŸ’‘ Tap a purple condition in the code to change it ! = NOT = flip it!
potion shelf preview LIVE
πŸ“œ Potion Rule
The potion bubbles when: the moon is full
πŸ§ͺ
Brewing…
check = TRUE NOT = OFF potion works = ?
Step 1 / 4
The Moon Potion bubbles when the moon is full. The moon IS full β€” brew it! Pick the moon condition and leave NOT off, then check your spell!
πŸŒ™ Condition β€” which check is the potion listening to?
πŸͺ„ NOT β€” one drop of opposite potion flips the rule!
Add NOT (!) in front of the check?
πŸ“‹ Your 4 Potion Challenges
0 of 4 challenges complete
πŸ§ͺ
You Brewed the Opposite Potion!
You flipped TRUE into FALSE and FALSE into TRUE with the NOT operator β€” the same trick real programs use to say "do this when it is NOT that"! Your potion recipe is ready to save and share! 🏰✨

πŸ’« What You Learned

  • NOT (!) flips any check: TRUE β†’ FALSE and FALSE β†’ TRUE. Opposite day for computers!
  • NOT + comparison: !(magicLevel > 5) is TRUE when magicLevel is 5 or less β€” the exact opposite of the plain check.
  • You can read ! out loud as "the opposite of": !(moon full) = "the opposite of moon-full".
  • After AND and OR, NOT completes your logic toolkit β€” now you can combine, compare, AND flip any rule!
  • You made My Opposite Potion β€” a real, shareable rule you designed yourself!
πŸ§ͺ Your Creation
My Opposite Potion
🏰 Come Back Tomorrow!
Next up: FUNCTIONS β€” package your potion rule into a reusable spell you can call anytime. One recipe, infinite potions!
🏠 Home
Nice! πŸŽ‰