51 lines
943 B
Markdown
Raw Normal View History

2016-03-25 16:47:20 -07:00
# strobe light quiz
2016-04-01 16:22:47 -07:00
Learn how to create a blinking LED script with a for loop.
2016-03-25 16:47:20 -07:00
## Name
## Directions
2016-04-13 08:27:45 -07:00
Use this activity document to guide your work in the [strobe light tutorial](/lessons/strobe-light/activity)
2016-03-25 16:47:20 -07:00
Answer the questions while completing the tutorial. Pay attention to the dialogues!
## 1. What is a for loop?
## 2. Draw which LEDs are ON after running this code
2016-03-30 13:41:01 -07:00
```blocks
2016-03-25 16:47:20 -07:00
for (let i = 0; i < 5; i++) {
for (let j = 0; j < 5; j++) {
led.plot(i, j)
}
}
```
![](/static/mb/empty-microbit.png)
## 3. Draw which LEDs are ON after running this code
2016-03-30 13:41:01 -07:00
```blocks
2016-03-25 16:47:20 -07:00
for (let i1 = 0; i1 < 3; i1++) {
for (let j1 = 0; j1 < 3; j1++) {
led.plot(i1, j1)
}
}
```
![](/static/mb/empty-microbit.png)
## 4. Draw which LEDs are ON after running this code
2016-03-30 13:41:01 -07:00
```blocks
2016-03-25 16:47:20 -07:00
for (let i2 = 0; i2 < 2; i2++) {
for (let j2 = 0; j2 < 2; j2++) {
led.plot(i2, j2)
}
}
```
![](/static/mb/empty-microbit.png)