pxt-calliope/docs/lessons/magic-logo/challenges.md

61 lines
989 B
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# magic logo challenges
Coding challenges for magic logo.
## Before we get started
Complete the [magic logo](/microbit/lessons/magic-logo/activity) activity and your code will look like this:
```blocks
input.onLogoUp(() => {
2016-03-31 00:11:05 +02:00
basic.showLeds(`
2016-03-26 00:47:20 +01:00
. . # . .
. # # # .
# # # # #
. . # . .
. . # . .
`)
})
```
### Challenge 1
How about when the logo is down? We should display an arrow pointing downward!
### @video td/videos/magic-logo-1-2
```blocks
input.onLogoUp(() => {
2016-03-31 00:11:05 +02:00
basic.showLeds(`
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
. . # . .
. . # . .
# # # # #
. # # # .
. . # . .
`)
})
```
### Challenge 2
Use the `on screen up` event to show a spinning arrow when the screen is turned up.
### Challenge 3
Display another animation using the `on screen up` event.