pxt-calliope/docs/reference/js/lessons/snowflake-fall/quiz-answers.md

57 lines
1.1 KiB
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# snowflake fall quiz answers
2016-04-02 01:22:47 +02:00
create a snowflake fall animation.
2016-03-26 00:47:20 +01:00
2016-04-13 17:27:45 +02:00
This is the answer key for the [snowflake fall quiz](/lessons/snowflake-fall/quiz).
2016-03-26 00:47:20 +01:00
## 1. In reference to an animation, what is an "interval"?
The number of milliseconds to pause after each image frame.
## 2. What is the interval of the animation?
```
basic.showAnimation(`
. . . . .
. . # . .
. # # # .
. . # . .
. . . . .
`, 400)
```
## 3. Write the code to allow this animation to never stop displaying on the BBC micro:bit
![](/static/mb/lessons/snowflake-fall-0.png)
```
basic.forever(() => {
basic.showAnimation(`
. . . . .
. . # . .
. # # # .
. . # . .
. . . . .
`, 400)
})
```
## 4. Write the code to create a forever loop that shows an animation of these images. Change the interval from 400 to 800 to make the animation go twice as slow!
![](/static/mb/lessons/snowflake-fall-1.png)
![](/static/mb/lessons/snowflake-fall-2.png)
```
basic.forever(() => {
basic.showAnimation(`
. . . . . # # # # #
. . # . . # # . # #
. # # # . # . # . #
. . # . . # # . # #
. . . . . # # # # #
`, 800)
})
```