moved remaining quizzes
This commit is contained in:
55
docs/lessons/rotation-animation/quiz-answers.md
Normal file
55
docs/lessons/rotation-animation/quiz-answers.md
Normal file
@ -0,0 +1,55 @@
|
||||
# rotation animation quiz answers
|
||||
|
||||
Learn how to create a rotating image with a while loop. #image #loop #while #docs
|
||||
|
||||
This is the answer key for the [rotation animation quiz](/microbit/lessons/rotation-animation/quiz).
|
||||
|
||||
## 1. What is a "global variable"?
|
||||
|
||||
Answers may vary. A global variable is a place where you can store data so that you can use it later in your code.
|
||||
|
||||
## 2. Consider the following directions
|
||||
|
||||
Write the code to create a **global variable** called `foo` that stores a boolean and initialize it to **false**.
|
||||
|
||||
```
|
||||
rotating = true
|
||||
```
|
||||
|
||||
## 3. Consider the following code
|
||||
|
||||
```
|
||||
while (rotating) {
|
||||
}
|
||||
```
|
||||
|
||||
Explain what this line of code does.
|
||||
|
||||
<br/>
|
||||
|
||||
It is 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 rectangle below represents the BBC micro:bit, shade the areas that will be displayed. Explain why that particular area is shaded.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Show animation will show a series of image frames on the LED screen, pausing the specified time (400 milliseconds) after each frame
|
||||
|
45
docs/lessons/rotation-animation/quiz.md
Normal file
45
docs/lessons/rotation-animation/quiz.md
Normal file
@ -0,0 +1,45 @@
|
||||
# rotation 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 [rotation animation tutorial](/microbit/lessons/rotation-animation/tutorial).
|
||||
|
||||
Answer the questions while completing the tutorial. Pay attention to the dialogues!
|
||||
|
||||
## 1. What is a "global variable"?
|
||||
|
||||
<br />
|
||||
|
||||
## 2. Write the code to create a global variable called foo that stores a boolean and initialize it to false.
|
||||
|
||||
<br/>
|
||||
|
||||
## 3. Explain why you use a while loop with a global variable
|
||||
|
||||
```
|
||||
while (rotating) {
|
||||
}
|
||||
```
|
||||
|
||||
<br/>
|
||||
|
||||
## 4. Draw the areas on the micro:bits to illustrate the code below. Explain why you chose to draw in those areas.
|
||||
|
||||
```
|
||||
basic.showAnimation(`
|
||||
# . . . . . . # . . . . . . # . . . . .
|
||||
. # . . . . . # . . . . . # . . . . . .
|
||||
. . # . . . . # . . . . # . . # # # # #
|
||||
. . . # . . . # . . . # . . . . . . . .
|
||||
. . . . # . . # . . # . . . . . . . . .
|
||||
`, 400)
|
||||
```
|
||||
|
||||

|
||||
|
||||
<br/>
|
||||
|
Reference in New Issue
Block a user