Migrate docs from the other repo
This commit is contained in:
64
docs/reference/js/lessons/snowflake-fall/challenges.md
Normal file
64
docs/reference/js/lessons/snowflake-fall/challenges.md
Normal file
@ -0,0 +1,64 @@
|
||||
# snowflake fall challenges
|
||||
|
||||
Coding challenges for the snowflake fall tutorial. #docs
|
||||
|
||||
## Before we get started
|
||||
|
||||
Complete the [snowflake fall](/microbit/lessons/snowflake-fall/activity) activity and your code will look like this:
|
||||
|
||||
```
|
||||
basic.forever(() => {
|
||||
basic.showAnimation(`
|
||||
. . . . .
|
||||
. . # . .
|
||||
. # # # .
|
||||
. . # . .
|
||||
. . . . .
|
||||
`, 400)
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
|
||||
### @video td/videos/snowflake-fall-1
|
||||
|
||||
Let's begin creating our falling effect by adding another snowflake with `basic->show animation` that displays a different snowflake pattern after the first one. We need 2 frames in the new animation that display both the first and the second snowflake images.
|
||||
|
||||
```
|
||||
basic.forever(() => {
|
||||
basic.showAnimation(`
|
||||
. . . . . . . # . .
|
||||
. . # . . . # . # .
|
||||
. # # # . # . . . #
|
||||
. . # . . . # . # .
|
||||
. . . . . . . # . .
|
||||
`, 400) // ***
|
||||
})
|
||||
```
|
||||
|
||||
* Run your program to see the cool animation.
|
||||
|
||||
### Challenge 2
|
||||
|
||||
### @video td/videos/snowflake-fall-2
|
||||
|
||||
To finalize our snowflake fall, let's add a different snowflake pattern.
|
||||
|
||||
```
|
||||
basic.forever(() => {
|
||||
basic.showAnimation(`
|
||||
. . . . . . . # . . . # . # .
|
||||
. . # . . . # . # . # # . # #
|
||||
. # # # . # . . . # . . . . .
|
||||
. . # . . . # . # . # # . # #
|
||||
. . . . . . . # . . . # . # .
|
||||
`, 400) // ***
|
||||
})
|
||||
```
|
||||
|
||||
* Run your program and see if it works.
|
||||
|
||||
### Challenge 3
|
||||
|
||||
Add a fourth frame to the current animation... or make it your own!
|
||||
|
Reference in New Issue
Block a user