Your browser is not supported. Please upgrade your browser to one of our supported browsers. You can try viewing the page, but expect functionality to be broken.
CS in Algebra curriculum and content is being deprecated. Within the next few months, this lab will no longer be available. Please check out Bootstrap: Algebra instead. Learn More.
Great! We've caught a codfish! Did you know if you feed a codfish to a dolphin, the dolphin will guide you to a shipwreck where there may be treasure? We must be getting closer. The next set of puzzles are bound to be trickier, so we better learn some more coding skills. What’s this? A cave?
Welcome, adventurers! My name is Squid. I noticed you were using the same set of commands over and over in some of the last puzzles. Must've been a bit tiresome. Do you ever wish you had a way to do something over and over again like, you know, washing dishes or brushing your teeth without getting tired or bored? That would be nice.
Computers are really good at doing the same thing over and over again using coding loops. When you want your program to do the same instructions many times, you can use a loop!
The loop block contains instructions that are repeated until the goal is reached. Once your program starts a "Repeat until goal" loop, it will keep repeating the instructions inside until it gets to the goal.
Try this for yourself! Place the commands you want to repeat inside the "Repeat until goal" block, click "Run", and watch it go!
Well, that was a little weird. Who knew squids could code? I didn't even think they had fingers. So now we know about loops. Let's use them to bag us some more treasure.