pxt-calliope/docs/lessons/guess-the-number/quiz.md
Sam El-Husseini 6f148c14e0 Fix randomInt
2018-06-01 11:42:38 -07:00

36 lines
852 B
Markdown

# guess the number quiz
Learn how to generate a random number on the @boardname@.
## Name
## Directions
Use this activity document to guide your work in the [guess the number tutorial](/lessons/guess-the-number/activity).
Answer the questions while completing the tutorial. Pay attention to the dialogues!
## 1. Describe what "input -> on button pressed" does?
<br />
## 2. Write the line of code that creates a condition for on button A pressed.
<br />
## 3. Write the line of code that creates a `local variable` called `randomNumber` and will return a number from 0 to a limit of 10.
<br />
## 4. Draw the area that could be lit based on the code below. Explain why you chose to draw that number.
```blocks
let randomNumber = Math.randomRange(0, 10)
basic.showNumber(randomNumber, 150)
```
![](/static/mb/empty-microbit.png)
<br />