pxt-calliope/olddocs/js/lessons/flipping-bird/quiz.md
2016-04-15 14:37:25 -07:00

61 lines
1.3 KiB
Markdown

# flipping bird quiz
use modulo with a conditional.
## Name
## Directions
Use this activity document to guide your work in the [flipping bird tutorial](/lessons/flipping-bird/tutorial).
Answer the questions while completing the tutorial. Pay attention to the dialogues!
## 1. What does "modulo" mean in math?
## 2. Consider the following directions
If the rectangle below represents the BBC micro:bit, shade in the LEDs that show the value being stored into the **global variable**, `count`.
```
count = 1
```
![](/static/mb/empty-microbit.png)
<br/>
<br/>
## 3. Consider the following code
If the rectangle below represents the BBC micro:bit, shade in the LEDs that show the value being stored into the **global variable**, `count`. Explain why that particular area is shaded.
```
count = 1
count_ = count_ + 2
```
![](/static/mb/empty-microbit.png)
<br/>
<br/>
## 4. Consider the following directions
Modulo (Mod) tells us what the remainder of a division is. For example, `15 mod 4 is 3` since 15 divided by 4 has a remainder of 3.
```
count = 12
count = math.mod(count, 5)
```
If the rectangle below represents the BBC micro:bit, shade in the LEDs that show the value being stored into the **global variable**, `count`. Explain why that particular area is shaded.
![](/static/mb/empty-microbit.png)
<br/>
<br/>