quiz updates

This commit is contained in:
Michael Elliot Braun
2016-03-29 13:13:18 -07:00
parent 5a8a5f82c9
commit 8cbd8e5a74
4 changed files with 21 additions and 23 deletions

View File

@ -22,23 +22,25 @@ input.onPinPressed(TouchPin.P0, () => {
## 3. What does this line of code doing?
![](/static/mb/blocks/lessons/love-meter-6.png)
```blocks
let x = Math.random(9)
```
<br/>
It stores random number between 0 and 9 then stores that number in a variable.
## 4. Why do you have to add 1 to variable x?
![](/static/mb/blocks/lessons/love-meter-7.png)
<br/>
```blocks
let item = 0;
item = 0;
basic.showNumber(item + 1);
```
You have to add 1 if you want to generate a random number between 1 and 10 .
## 5. Why do you have to hold ground (GND) to make this work on the micro:bit?
<br/>
You have told GND to complete the circuit.