pxt-calliope/docs/reference/js/lessons/flipping-bird/quiz.md
2016-04-13 08:27:45 -07:00

1.3 KiB

flipping bird quiz

use modulo with a conditional.

Name

Directions

Use this activity document to guide your work in the 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



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



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.