Discover Python
Everything from movement through loops, conditions to nested structures in your winter journey with Python
Awesome! I can't get enough of this! How about we start collecting some candy canes?
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!
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.
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.
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!
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 Python
Everything from movement through loops, conditions to nested structures in your winter journey with Python