Fix failing snippets for tele-potato (#938)

This commit is contained in:
Galen Nickel 2018-07-09 11:16:22 -07:00 committed by GitHub
parent 9bdf1c78a8
commit 5d6481a4e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 21 deletions

View File

@ -34,8 +34,7 @@ Here are some fun programs for your @boardname@!
"description": "Approximate the number Pi", "description": "Approximate the number Pi",
"url": "/examples/pi-montecarlo", "url": "/examples/pi-montecarlo",
"cardType": "example" "cardType": "example"
} }]
]
``` ```
## Sensors ## Sensors

View File

@ -56,7 +56,7 @@ To make the game less predictable, we use the ``||math:pick random||`` block to
```blocks ```blocks
let potato = 0 let potato = 0
input.onButtonPressed(Button.AB, () => { input.onButtonPressed(Button.AB, () => {
potato = 10 + Math.random(21) potato = Math.randomRange(10, 20)
}) })
``` ```
@ -82,7 +82,7 @@ The **receivedNumber** represents the potato and is stored in the **potato** var
```blocks ```blocks
let potato = 0 let potato = 0
radio.onDataPacketReceived( ({ receivedNumber }) => { radio.onReceivedNumber(function (receivedNumber) {
potato = receivedNumber potato = receivedNumber
}) })
``` ```
@ -119,7 +119,7 @@ Get two or more @boardname@s and download the code to them. One player starts th
```blocks ```blocks
let potato = 0 let potato = 0
radio.onDataPacketReceived( ({ receivedNumber }) => { radio.onReceivedNumber(function (receivedNumber) {
potato = receivedNumber potato = receivedNumber
}) })
input.onGesture(Gesture.Shake, () => { input.onGesture(Gesture.Shake, () => {
@ -129,7 +129,7 @@ input.onGesture(Gesture.Shake, () => {
} }
}) })
input.onButtonPressed(Button.AB, () => { input.onButtonPressed(Button.AB, () => {
potato = 10 + Math.random(21) potato = Math.randomRange(10, 20)
}) })
radio.setGroup(1) radio.setGroup(1)
potato = -1 potato = -1