batch replace onButtonPressed(Button...

This commit is contained in:
Peli de Halleux
2016-03-29 21:17:57 -07:00
parent 1f7e0b0f79
commit 850c313c5d
68 changed files with 187 additions and 187 deletions

View File

@ -15,14 +15,14 @@ To create a new script, go to the [Create Code](/microbit/create-code) page and
Add an event handler when button `A` is pressed.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
})
```
Create a local variable of type number `x` and set it to a random number using `math->random`. `math->random(10)` generates a random number between `0` and `10` **excluded**.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
let x = Math.random(10)
})
```
@ -30,7 +30,7 @@ input.onButtonPressed("A", () => {
Show the random number on the screen.
```
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
let x1 = Math.random(10)
basic.showNumber(x1, 150)
})