Do you know what is a loop? How might it be used in programming?
You have three programs that you need loops for. Which loop would you use for each program? Each type of loop is used only once. Discuss with your classmates:
- For playing your favorite song three times
- For flying your CoDrone until the space key is hit
- For keeping a digital clock running
Activity: Stair challenge
Make your CoDrone fly up a set of stairs (fly up, forward, up, forward, etc) and then fly back down!
- Use variables for delays.
- Use loops for any code that will be repeated more than once. Hint: you should have two loops in your program!
- Your CoDrone has to fly up at least three stairs.
- Your CoDrone needs to land!