โ† Home BP ยท 7-9 ๐Ÿชธ

Coral Guard

57
๐ŸŽฏ Today's Missions
๐Ÿ  ๐Ÿชธ ๐Ÿก ๐Ÿฆ‘
๐Ÿชธ
Ocean Lab Universe
Coral Guard
You're the Coral Guard! Protect the reef by programming IF/ELSE rules โ€” decisions that check what's true and choose what to do. IF a fish is a friend โ†’ welcome it! ELSE โ†’ warn it away! Every computer decision starts with IF!

โšก Today's Concept: Conditionals (IF / ELSE)

An IF/ELSE statement is how computers make decisions. You give it a condition โ€” a TRUE/FALSE check โ€” and it does one thing IF true, and a different thing ELSE (if false). It's like a fork in the road: IF the path is clear โ†’ walk straight. ELSE (if blocked) โ†’ take a detour! Every app, game, and website uses IF/ELSE to make choices!

๐Ÿค” Condition โ€” a TRUE/FALSE question โœ… IF true โ€” do this action โŒ ELSE โ€” do that action instead
โ† Last time you learned BOOLEAN LOGIC (TRUE/FALSE). Now you'll use those TRUE/FALSE checks to make IF/ELSE decisions โ€” the most powerful tool in every program!
Step 1 / 4
A friendly fish approaches! Set the rule: IF creature is friendly โ†’ Wave. ELSE โ†’ Hide. Then press the check button!
โ— CORAL REEF โ€” Live
๐Ÿ  Decision Result
๐Ÿชธ ๐Ÿชท ๐ŸŒฟ ๐ŸŒฟ
A creature approaches! Set your rule and press Check!
๐Ÿ‘‹ Who's Visiting?
๐ŸŸ
Blue Tang
A friendly little fish looking for food!
๐Ÿง  Your Decision Rule
IF THEN
โ€” ELSE โ€”
ELSE
๐Ÿ“‹ What Will Happen
โœ…
IF true: Wave ๐Ÿ‘‹
โŒ
ELSE: Hide ๐Ÿ™ˆ
๐Ÿ“‹ Your 4 Coral Challenges
0 of 4 challenges complete
๐Ÿชธ
You're a Coral Guard!
You programmed IF/ELSE rules for every creature โ€” the reef is safe thanks to your decision-making code! ๐Ÿ โœจ

๐Ÿ’ซ What You Learned

  • IF/ELSE is how computers make decisions โ€” check a condition, then choose the right action.
  • The condition is a TRUE/FALSE question. IF it's true, run the first action. ELSE run the other.
  • You can change conditions and actions to create different rules for different situations.
  • Every program uses conditionals โ€” games, apps, websites โ€” they all make IF/ELSE choices!
  • Boolean logic (TRUE/FALSE) powers every IF check. You already learned that โ€” now you used it!
๐ŸŽฌ Come Back Tomorrow!
Next up: combine IF/ELSE with loops to build a creature counter that checks every visitor automatically!
๐Ÿ  Home
Nice! ๐ŸŽ‰