pxt-calliope/docs/lessons/magic-logo/quiz-answers.md

57 lines
1009 B
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# magic logo quiz answers
2016-04-02 01:22:47 +02:00
show an image that points up when the logo is up.
2016-03-26 00:47:20 +01:00
## Name
## Directions
2016-04-13 17:27:45 +02:00
This is the answer key for the [magic logo quiz](/lessons/magic-logo/quiz)
2016-03-26 00:47:20 +01:00
Answer the questions while completing the tutorial. Pay attention to the dialogues!
## 1. Define 'on logo up'
A function that will run code when the @boardname@ screen is facing up and vertically orientated.
2016-03-26 00:47:20 +01:00
<br/>
## 2. Write the condition that detects when the @boardname@ logo is facing up and vertically orientated.
2016-03-30 22:41:01 +02:00
The `logo up` event is raised when...
* the screen is facing up and the board is horizontal
* the screen is facing down and the board is horizontal
* the board is vertical and the logo is facing up
2016-03-26 00:47:20 +01:00
<br/>
2016-03-30 22:41:01 +02:00
```blocks
2016-03-26 00:47:20 +01:00
input.onLogoUp(() => {
})
```
<br/>
2016-03-30 22:41:01 +02:00
## 3. Write the code to display a downward pointing arrow when the logo is down.
2016-03-26 00:47:20 +01:00
![](/static/mb/lessons/magic-logo-0.png)
2016-03-30 22:41:01 +02:00
2016-03-26 00:47:20 +01:00
<br/>
2016-03-30 22:41:01 +02:00
```blocks
2016-03-26 00:47:20 +01:00
input.onLogoDown(() => {
2016-03-31 00:11:05 +02:00
basic.showLeds(`
2016-03-26 00:47:20 +01:00
. . # . .
. . # . .
# # # # #
. # # # .
. . # . .
`)
})
```