>> Chomperbot: Good evening human children, and welcome back to Chompers. Your twice daily tooth brushing show.
Start brushing on one side of the top of your mouth. And remember to brush the inside, outside and chewing side of each tooth.
>> KIDS: 3, 2, 1 brush!!
>> Chomperbot: I’m Chomperbot, here to host the show while Rachel charges her human batteries.
Tonight I have more iCode for you. I will describe a word used in code and you have to guess what it is.
Ready for your first one?
This is a word used to describe something that repeats. Like if I want to code my robot to plant 5 flowers in a row, I would use this to tell my robot to repeat the action of “plant a flower” five times, because it’s faster than saying
Plant a flower
Plant a flower
Plant a flower
Plant a flower
Plant a flower.
Switch your brushing to the other side of the top of your mouth, and keep brushing.
So what’s the word for when you’re repeating something when you write code? What do iCode?
>> GROUP:: A LOOP!
>> Chomperbot: A loop is the word for “repeating” when you’re writing code. I can write a loop for a number, like “plant 5 flowers.” Or I can use a loop to repeat something FOREVER, like how a clock keeps ticking forever and ever!
Switch your brushing to the bottom of your mouth, and don’t forget your front teeth!
Ready for your next I Code?
This is a word that tells a computer to make a CHOICE! It tells the computer to check IF something is true before moving forward. We can use a traffic light as an example. When a car reaches a traffic light, the driver looks to see what color the light is. IF it’s red, THEN the driver stops the car, [breaking] and IF it’s green THEN the driver keeps going. [driving]
So, what am I describing? What do iCode?
[switch bell]
I’ll tell you after you switch your brushing to the other side of bottom of your mouth, and don’t forget the molars in the way back.
>> GROUP:: An IF/Then Statement!
>> Chomperbot: An IF-THEN statement. An if-then statement is a way to tell your computer to do something only IF something else is true. Like telling a driver // IF the light is red THEN stop your car. You might tell a website IF someone clicks this button THEN start playing the video. [SFX VIDEO]
We’ve reached the end of my code for tonight. IF I have nothing else to teach you THEN it’s time to…
>> KIDS: 3, 2, 1 spit!!