quiz updates
This commit is contained in:
@ -22,23 +22,25 @@ input.onPinPressed(TouchPin.P0, () => {
|
||||
|
||||
## 3. What does this line of code doing?
|
||||
|
||||

|
||||
```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?
|
||||
|
||||

|
||||
|
||||
<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.
|
||||
|
||||
|
Reference in New Issue
Block a user