put lessons back for Michael
This commit is contained in:
63
docs/lessons/snowflake-fall/activity.md
Normal file
63
docs/lessons/snowflake-fall/activity.md
Normal file
@ -0,0 +1,63 @@
|
||||
# snowflake fall blocks activity
|
||||
|
||||
design a blinking rectangle animation.
|
||||
|
||||
### ~avatar avatar
|
||||
|
||||
|
||||
|
||||
Welcome! This tutorial will teach how design a **snowfall animation**. Let's get started!
|
||||
|
||||
### ~
|
||||
|
||||
Let's start by creating a `forever` loop that will allow us to repeat the show LEDs code. Any code in the `forever` loop will repeat in the background... forever.
|
||||
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
basic.showLeds(`
|
||||
. . . . .
|
||||
. . # . .
|
||||
. # # # .
|
||||
. . # . .
|
||||
. . . . .
|
||||
`)
|
||||
basic.showLeds(`
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
`)
|
||||
})
|
||||
```
|
||||
|
||||
The next step is to add two `show LEDs` blocks inside the `forever` loop to repeat an animation.
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
basic.showLeds(`
|
||||
. . . . .
|
||||
. . # . .
|
||||
. # # # .
|
||||
. . # . .
|
||||
. . . . .
|
||||
`)
|
||||
basic.showLeds(`
|
||||
. . # . .
|
||||
. # . # .
|
||||
# . . . #
|
||||
. # . # .
|
||||
. . # . .
|
||||
`)
|
||||
})
|
||||
```
|
||||
|
||||
Run your code in the simulator or download it to your BBC micro:bit to see what happens!
|
||||
|
||||
### ~avatar avatar
|
||||
|
||||
Excellent, you're ready to continue with the [challenges](/lessons/snowflake-fall/challenges)!
|
||||
|
||||
### ~
|
||||
|
68
docs/lessons/snowflake-fall/challenges.md
Normal file
68
docs/lessons/snowflake-fall/challenges.md
Normal file
@ -0,0 +1,68 @@
|
||||
# snowflake fall blocks challenges
|
||||
|
||||
Coding challenges for snowflake fall.
|
||||
|
||||
## Before we get started
|
||||
|
||||
Complete the [snowflake fall](/lessons/snowflake-fall/activity) activity and your code will look like this:
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
basic.showLeds(`
|
||||
. . . . .
|
||||
. . # . .
|
||||
. # # # .
|
||||
. . # . .
|
||||
. . . . .
|
||||
`)
|
||||
basic.showLeds(`
|
||||
. . # . .
|
||||
. # . # .
|
||||
# . . . #
|
||||
. # . # .
|
||||
. . # . .
|
||||
`)
|
||||
})
|
||||
```
|
||||
|
||||
### Challenge 1
|
||||
|
||||
|
||||
|
||||
To finalize our snowflake fall, let's add a different snowflake pattern.
|
||||
|
||||
```blocks
|
||||
|
||||
basic.forever(() => {
|
||||
basic.showLeds(`
|
||||
. . . . .
|
||||
. . # . .
|
||||
. # # # .
|
||||
. . # . .
|
||||
. . . . .
|
||||
`)
|
||||
basic.showLeds(`
|
||||
. . # . .
|
||||
. # . # .
|
||||
# . . . #
|
||||
. # . # .
|
||||
. . # . .
|
||||
`)
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
# # # # #
|
||||
. # . # .
|
||||
# # # # #
|
||||
. # . # .
|
||||
`)
|
||||
})
|
||||
|
||||
```
|
||||
|
||||
|
||||
* Run your program and see if it works.
|
||||
|
||||
### Challenge 3
|
||||
|
||||
Add a fourth frame to the current animation... or make it your own!
|
||||
|
73
docs/lessons/snowflake-fall/quiz-answers.md
Normal file
73
docs/lessons/snowflake-fall/quiz-answers.md
Normal file
@ -0,0 +1,73 @@
|
||||
# snowflake fall blocks quiz answers
|
||||
|
||||
Create a snowflake fall animation.
|
||||
|
||||
This is the answer key for the [snowflake fall quiz](/lessons/snowflake-fall/quiz).
|
||||
|
||||
## 1. What is a forever loop?
|
||||
|
||||
Run code in the background forever (answers may vary).
|
||||
|
||||
## 2. Draw the picture that will be produced with this code
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||

|
||||
|
||||
## 3.Write the code for a forever loop and show LEDS for these images!
|
||||
|
||||

|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
basic.showLeds(`
|
||||
. . . . .
|
||||
. . # . .
|
||||
. # # # .
|
||||
. . # . .
|
||||
. . . . .
|
||||
`);
|
||||
basic.showLeds(`
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
. . . . .
|
||||
`)
|
||||
});
|
||||
```
|
||||
|
||||
## 4. Write the code for a forever loop and show LEDS for these images!
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
basic.showLeds(`
|
||||
. . . . .
|
||||
. . # . .
|
||||
. # # # .
|
||||
. . # . .
|
||||
. . . . .
|
||||
`);
|
||||
basic.showLeds(`
|
||||
# # # # #
|
||||
# # . # #
|
||||
# . # . #
|
||||
# # . # #
|
||||
# # # # #
|
||||
`)
|
||||
});
|
||||
```
|
46
docs/lessons/snowflake-fall/quiz.md
Normal file
46
docs/lessons/snowflake-fall/quiz.md
Normal file
@ -0,0 +1,46 @@
|
||||
# snowflake fall blocks quiz
|
||||
|
||||
Create a snowflake fall animation
|
||||
|
||||
## Name
|
||||
|
||||
## Directions
|
||||
|
||||
Use the hints in the [snowflake fall activity](/lessons/snowflake-fall/activity) to answer this quiz!
|
||||
|
||||
## 1. What is a forever loop?
|
||||
|
||||
|
||||
|
||||
## 2. Draw the picture that will be produced with this code
|
||||
|
||||
```blocks
|
||||
basic.forever(() => {
|
||||
basic.showLeds(`
|
||||
. # . # .
|
||||
# # # # #
|
||||
# # # # #
|
||||
. # # # .
|
||||
. . # . .`);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
## 3. Write the code for a forever loop and show LEDS for these images!
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
## 4. Write the code for a forever loop and show LEDS for these images!
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user