The answers to the love meter quiz.
This is the answer key for the love meter quiz.
It's a method that runs code when the user holds the GND pin with a finger of one hand and presses pin P0, completing a circuit.
Create a condition for on pin pressed (P0)
.
input.onPinPressed(TouchPin.P0, () => {
})
let x = Math.randomRange(0, 9)
It stores random number between 0 and 9 then stores that number in a variable.
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 .
You have told GND to complete the circuit.