Coding Adventure 3: Let's collect candy canes

Discover JavaScript

Everything from movement through loops, conditions to nested structures in your winter journey with Java Script

JOIN

Description

Awesome! I can't get enough of this! How about we start collecting some candy canes?

Preview Video

Coding Missions

Watch out! Cracked ice!

Here we go! Let's pick up that red candy cane. I need to go one step forward and stop if the ice starts cracking!

Check for cracked ice

Alright! watch out now; We need to take one step and check if the ice is not cracked then we can go forward another step to pick up the red candy cane. If the ice is cracked ice, we need to make a right turn to pick up that candy cane ornament.

Red candy cane at the center

Now, we need to plan well! If the ice is thin we will get that red candy cane on the left. Otherwise, we will get that candy cane on our right.

Where is the green candy cane?

So, our next move is like this: We take one step forward and check the ice cell, if the ice is thin the candy cane will be to the left. If the ice patch is cracked, then we need to move one step to the right to pick it up. Wait! we are not done yet! If the ice is neither thin nor cracked, then it will be on two steps behind us!

Let's draw another letter!

One last thing to do on this adventure. We need to skate around to collect the last of the red candy canes while writing another letter on the ice to complete our Christmas good wishes to all.

Discover JavaScript

Everything from movement through loops, conditions to nested structures in your winter journey with Java Script

JOIN
Canada Flag Privacy Policy Terms of Use
Got an invite