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

1.1 KiB

flipping bird quiz answers

use modulo with a conditional.

This is the answer key for the flipping bird quiz.

1. What does "modulo" mean in math?


Modulo (or Mod) is the remainder of a division problem.

2. 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


The variable count is now equal to 3.


3. 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.



The display will show 2 because the remainder of 12 divided by 5 is 2.