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.
|
||||
|
||||
|
@ -18,13 +18,20 @@ Answer the questions below while completing the activity. Pay attention to the d
|
||||
|
||||
## 3. Describe what this line of code does?
|
||||
|
||||

|
||||
```blocks
|
||||
let x = Math.random(9)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## 4. Describe what adding 1 to variable x does?
|
||||
|
||||

|
||||
```blocks
|
||||
let item = 0;
|
||||
item = 0;
|
||||
basic.showNumber(item + 1);
|
||||
```
|
||||
|
||||
|
||||
|
||||
## 5. Describe why you must hold ground (GND) before pressing (P0) to run a program using `on pin pressed(P0)` on the micro:bit
|
||||
|
Reference in New Issue
Block a user