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

@ -22,7 +22,7 @@ The code under ``on button pressed("A")`` will run each time the user presses A.
```
let count_ = 0
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
count = count + 1
})
```
@ -31,7 +31,7 @@ Since the count has changed, it's time to refresh the screen display. Let's add
```
let count_1 = 0
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
count = count + 1
basic.showNumber(count, 150)
})

View File

@ -8,7 +8,7 @@ Complete the following [guided tutorial](/microbit/lessons/counter/activity) At
```
let count = 0
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
count = count + 1
basic.showNumber(count, 150)
})
@ -22,11 +22,11 @@ Let's add the code to `count` when `B` is pressed. Add an event handler with `in
```
let count1 = 0
input.onButtonPressed("A", () => {
input.onButtonPressed(Button.A, () => {
count1 = count1 + 1
basic.showNumber(count1, 150)
})
input.onButtonPressed("B", () => {
input.onButtonPressed(Button.B, () => {
count1 = count1 - 1 // ***
basic.showNumber(count1, 150) // ***
}) // ***