pxt-calliope/olddocs/js/lessons/screen-wipe/quiz-answers.md

46 lines
995 B
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# screen wipe quiz answers
2016-04-02 01:22:47 +02:00
clear the screen by pressing the "A" button after an animation has been played.
2016-03-26 00:47:20 +01:00
2016-04-13 17:27:45 +02:00
This is the answer key for the [screen wipe quiz](/lessons/screen-wipe/quiz).
2016-03-26 00:47:20 +01:00
## 1. What does the function "clear screen" do on the @boardname@?
2016-03-26 00:47:20 +01:00
This function turns off all the LED lights on the LED screen.
## 2. Write the line of code that creates and displays this animation.
![](/static/mb/lessons/screen-wipe-0.png)
<br/>
```
basic.showAnimation(`
# # # # . # # # # # . . . . . . . . . .
# # # # # # # # # # . . . . . . . . . .
. . . . . # # # # # # # # # # . . . . .
. . . . . # # # # # # # # # # # # # # #
. . . . . . . . . . . . . . . # # # # #
`, 400)
```
## 3. Write the condition that will detect when the @boardname@ is shaken.
2016-03-26 00:47:20 +01:00
<br/>
```
input.onGesture(Gesture.Shake, () => {
})
```
## 4. Write the code that will clear an animation from the screen after shaking the @boardname@.
2016-03-26 00:47:20 +01:00
<br/>
```
input.onGesture(Gesture.Shake, () => {
basic.clearScreen()
})
```