Migrate docs from the other repo
This commit is contained in:
77
docs/reference/js/lessons/rotating-animation/quiz.md
Normal file
77
docs/reference/js/lessons/rotating-animation/quiz.md
Normal file
@ -0,0 +1,77 @@
|
||||
# rotating animation quiz
|
||||
|
||||
Learn how to create a rotating image with a while loop. #image #loop #while #docs
|
||||
|
||||
## Name
|
||||
|
||||
## Directions
|
||||
|
||||
Use this activity document to guide your work in the [rotating animation tutorial](/microbit/js/tutorials/rotating-animation).
|
||||
|
||||
Answer the questions below while working on or after you finish the tutorial. Pay attention to the dialogs!
|
||||
|
||||
## 1. What is a while loop?
|
||||
|
||||
## 2. Consider the following directions
|
||||
|
||||
Write the code to create a **global variable** called `rotating` and initialize it to **true**.
|
||||
|
||||
## 3. Consider the following directions
|
||||
|
||||
Write the code to create a **while** loop that will be executed only if the **global variable** called `rotating` is **true**.
|
||||
|
||||
## 4. Consider the following code
|
||||
|
||||
```
|
||||
basic.showAnimation(`
|
||||
# . . . . . . # . . . . . . # . . . . .
|
||||
. # . . . . . # . . . . . # . . . . . .
|
||||
. . # . . . . # . . . . # . . # # # # #
|
||||
. . . # . . . # . . . # . . . . . . . .
|
||||
. . . . # . . # . . # . . . . . . . . .
|
||||
`, 400)
|
||||
```
|
||||
|
||||
If the rectangles below represents a board that is 5 LEDs wide and 5 LEDs tall, place an X approximately where the LED is lighted in the series. Explain why the LED is lighted there.
|
||||
|
||||

|
||||
|
||||
******************************
|
||||
|
||||
## ANSWER KEY
|
||||
|
||||
## Directions
|
||||
|
||||
Answer the questions below while working on or after you finish the tutorial.
|
||||
|
||||
## 2. Consider the following directions
|
||||
|
||||
Write the line of code to create a **global variable** called `rotating` and initialize it to **true**.
|
||||
|
||||
```
|
||||
rotating = true
|
||||
```
|
||||
|
||||
## 3. Consider the following directions
|
||||
|
||||
Write the line of code that create a **while** loop that will be executed only if the **global variable** called `rotating` is **true**.
|
||||
|
||||
```
|
||||
while (rotating) {
|
||||
}
|
||||
```
|
||||
|
||||
## 4. Consider the following code
|
||||
|
||||
```
|
||||
basic.showAnimation(`
|
||||
# . . . . . . # . . . . . . # . . . . .
|
||||
. # . . . . . # . . . . . # . . . . . .
|
||||
. . # . . . . # . . . . # . . # # # # #
|
||||
. . . # . . . # . . . # . . . . . . . .
|
||||
. . . . # . . # . . # . . . . . . . . .
|
||||
`, 400)
|
||||
```
|
||||
|
||||
If the rectangles below represents a board that is 5 LEDs wide and 5 LEDs tall, place an X approximately where the LED is lighted in the series. Explain why the LED is lighted there.
|
||||
|
Reference in New Issue
Block a user