pxt-calliope/olddocs/lessons/rotation-animation/quiz.md
Tom Ball f4eca66648 move lessons out of web site
will move select lessons back to "educators" section
2016-06-14 11:49:58 -04:00

1.4 KiB

rotation animation quiz

Learn how to create a rotating image with a while loop.

Name

Directions

Use this activity document to guide your work in the rotation animation tutorial.

Answer the questions while completing the tutorial. Pay attention to the dialogues!

1. What is a " variable"?


2. Write the code to create a variable called foo that stores a boolean and initialize it to false.


3. Explain why you use a while loop with a variable

let rotating = true;
while (rotating) {
    basic.showLeds(`
        . . . . .
        . . . . .
        . . # . .
        . . . . .
        . . . . .
        `)
    basic.showLeds(`
        . . . . .
        . . . . .
        . . . . .
        . . . . .
        . . . . .
        `)
}


4. Draw the areas on the micro:bits to illustrate the code below. Explain why you chose to draw in those areas.

basic.showLeds(`
        . . # . .
        . . # . .
        . . # . .
        . . # . .
        . . # . .
        `)
basic.showLeds(`
        . . . . .
        . . . . .
        # # # # #
        . . . . .
        . . . . .
        `)
basic.showLeds(`
        . . . . #
        . . . # .
        . . # . .
        . # . . .
        # . . . .
        `)
basic.showLeds(`
        . . . . #
        . . . # .
        . . # . .
        . # . . .
        # . . . .
        `)