Skip to content

Progresbyte/CodeQuest-Mini-Games

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Learn If/Else with JavaScript: Interactive Game

Welcome to CodeQuest! Help our character, Robo, decide what to do based on the weather. Drag the correct code blocks to complete the program.


🕹️ The Challenge

Robo wants to know if he should take an umbrella. The weather can be "rainy" or "sunny". Complete the code so Robo reacts correctly!


1. Drag the Code Blocks

if (weather === "rainy") {
    // Robo takes an umbrella
} else {
    // Robo enjoys the sun
}

Code Blocks:

  • weather === "rainy"
  • Robo.takeUmbrella();
  • Robo.enjoySun();

2. Complete the Program

Drag and drop the code blocks into the correct places:

let weather = prompt("Is it 'rainy' or 'sunny'?");

if (__________) {
    __________;
} else {
    __________;
}

3. Robo Reacts!

🤖

Try it out:
Open your browser console and run the completed code to see Robo's reaction!


💡 Hint

  • Use Robo.takeUmbrella(); if it's rainy.
  • Use Robo.enjoySun(); if it's sunny.

Happy coding!

About

A set of mini-games teaching basic programming logic (if/else, loops, arrays)!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published