On Gesture
Start an event handler (part of the program that will run when something happens) This handler works when you do a gesture (like shaking the board).
input.onGesture(Gesture.Shake,() => {
})
Parameters
gesturemeans the way you hold or move the board. This can beshake,logo up,logo down,screen up,screen down,tilt left,tilt right,free fall,3g, or6g.
Example: random number
This program shows a number from 2 to 9 when you shake the board.
input.onGesture(Gesture.Shake,() => {
let x = randint(2, 9)
basic.showNumber(x)
})