guess the number activity
Guess the number with math random.
Add an event handler when button A
is pressed.
input.onButtonPressed(Button.A, () => {
})
Create a local variable of type number x
and set it to a random number using pick random
. pick random
9 generates a random number between 0
and 9
.
input.onButtonPressed(Button.A, () => {
let x = randint(0, 10)
})
Show the random number on the screen.
input.onButtonPressed(Button.A, () => {
let x = randint(0, 10)
basic.showNumber(x)
})