pxt-calliope/docs/lessons/screen-wipe/quiz-answers.md

43 lines
837 B
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# screen wipe quiz blocks answers
Clear the screen by pressing the "A" button after an animation has been played
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
2016-11-02 01:44:37 +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 displays this image.
![](/static/mb/blocks/lessons/screen-wipe-4.png)
2016-03-29 20:57:50 +02:00
```blocks
basic.showLeds(`
. # . # .
. # . # .
. . # . .
# . . . #
. # # # .
`)
```
2016-03-26 00:47:20 +01:00
## 3. Write the condition that will detect on button A pressed
2016-03-29 20:57:50 +02:00
```blocks
input.onButtonPressed(Button.A, () => {
})
```
2016-03-26 00:47:20 +01:00
## 4. Write the code that will clear show LEDS from the screen after pressing button A
2016-03-29 20:57:50 +02:00
```blocks
input.onButtonPressed(Button.A, () => {
basic.clearScreen()
})
```
2016-03-26 00:47:20 +01:00