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'
|
|
|
|
|
2016-11-01 18:42:42 +01:00
|
|
|
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/>
|
|
|
|
|
2016-11-01 18:42:42 +01:00
|
|
|
## 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
|
2018-11-10 00:36:46 +01:00
|
|
|
input.onGesture(Gesture.LogoUp, function () {
|
2016-03-26 00:47:20 +01:00
|
|
|
})
|
|
|
|
```
|
|
|
|
|
|
|
|
<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
|
2018-11-10 00:36:46 +01:00
|
|
|
input.onGesture(Gesture.LogoDown, function () {
|
2016-03-31 00:11:05 +02:00
|
|
|
basic.showLeds(`
|
2016-03-26 00:47:20 +01:00
|
|
|
. . # . .
|
|
|
|
. . # . .
|
|
|
|
# # # # #
|
|
|
|
. # # # .
|
|
|
|
. . # . .
|
|
|
|
`)
|
|
|
|
})
|
|
|
|
```
|
|
|
|
|