โ† Lessons BUILDER PATH

๐Ÿœ๏ธ Desert Decisions

Lesson 34
๐Ÿซ
Themed Universe
Desert Oasis
Lead the caravan across the dunes โ€” code that DECIDES: if there's enough water, cross; else, rest in the shade! ๐ŸŒด
๐Ÿงญ
Today's concept: if / else โ€” code that chooses! A condition is a yes/no question. If the answer is true, the if block runs; if false, the else block runs instead. Edit the gold number and watch the caravan's decision flip live!
๐ŸŽฏ Missions Day โœฆ
โ€ฆ
โ€ฆ
โ€ฆ
โ— โ— โ— caravan.js JavaScript

  
dunes LIVE

๐Ÿœ๏ธ Caravan Mission Step 1 of 5

โ€ฆ

๐Ÿ’ก Hint: โ€ฆ

๐Ÿœ๏ธ Desert Decisions

In Lesson 4 (Variable Vault) you stored values in variables โ€” tickets, flips, names. A program that only remembers things can't choose. Today you give your code a brain: the if / else statement. It asks a yes/no question, then picks a path. You're the Caravan Master crossing the ๐Ÿœ๏ธ Desert Oasis โ€” every decision (cross or rest, day or night, open or locked) is an if statement your code decides!

๐Ÿงญ if / else Toolkit
if (water > 3) {"cross the dune!"}
else {"rest in the shade."}
โ†’ edit the gold number โ†’ the decision flips live!
๐Ÿ”€A condition is a yes/no check: water > 3 is true when water is more than 3.
โœ…If true, the if block runs. If false, the else block runs instead.
โœ๏ธEdit the gold box in the code โ†’ the caravan's decision updates live!
๐ŸŽฏHit โœ“ Check when the dunes show the right outcome to complete each mission.