Rotate your device.
Turn off orientation lock in device settings.
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.
Rotate your device.
Turn off orientation lock in device settings.
Help! Fix the program so my field will be completely flat.
This is a modal window.
Beginning of dialog window. Escape will cancel and close the window.
End of dialog window.
Hi, I'm Bill! Let's learn a new fundamental concept: "If" statements. This is how computers make decisions.
You use "If" statements yourself everday. Before you go outside each morning, you say IF it's raining outside, I need to wear my jacket.
We can tell the zombie to check IF there's path to the left, and if he finds a path to the left, we can have him turn in that direction.
To write the code for this, let's drag out our "if" block and put a "turn left" block inside it.
Now, if we put a "move forward" block above it and a "repeat" block around everything, each time the zombie moves, he'll check if there's a path to the left and turn. The "repeat" command is critical, to check for a turn at every step.
If statements are really important in computer science. One of the first programs I wrote was a tic-tac-toe game, and there was a If statement that said IF the other person is about to win, block the spot that lets them win.
Have fun using the "if" block!