Fix failing snippets for tele-potato ()

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

@ -8,25 +8,25 @@ Here are some fun programs for your @boardname@!
[{ [{
"name": "Blinky", "name": "Blinky",
"description": "A blinking pattern of LEDs", "description": "A blinking pattern of LEDs",
"url":"/examples/blinky", "url": "/examples/blinky",
"cardType": "example" "cardType": "example"
}, },
{ {
"name": "Name Tag", "name": "Name Tag",
"description": "Scroll your name on the screen", "description": "Scroll your name on the screen",
"url":"/examples/name-tag", "url": "/examples/name-tag",
"cardType": "example" "cardType": "example"
}, },
{ {
"name": "Rando", "name": "Rando",
"description": "Randomly blinking LEDs", "description": "Randomly blinking LEDs",
"url":"/examples/rando", "url": "/examples/rando",
"cardType": "example" "cardType": "example"
}, },
{ {
"name": "Game of Life", "name": "Game of Life",
"description": "A Game of Life simulation in LEDs", "description": "A Game of Life simulation in LEDs",
"url":"/examples/gameofLife", "url": "/examples/gameofLife",
"cardType": "example" "cardType": "example"
}, },
{ {
@ -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
@ -44,32 +43,32 @@ Here are some fun programs for your @boardname@!
[{ [{
"name": "Egg & Spoon race", "name": "Egg & Spoon race",
"description": "Balance a micro:bit like an egg and spoon race", "description": "Balance a micro:bit like an egg and spoon race",
"url":"/examples/egg-and-spoon", "url": "/examples/egg-and-spoon",
"cardType": "example" "cardType": "example"
},{ },{
"name": "Plot Acceleration", "name": "Plot Acceleration",
"description": "Chart acceleration on the LED screen", "description": "Chart acceleration on the LED screen",
"url":"/examples/plot-acceleration", "url": "/examples/plot-acceleration",
"cardType": "example" "cardType": "example"
}, { }, {
"name": "Plot Light Level", "name": "Plot Light Level",
"description": "Chart light level on the LED screen", "description": "Chart light level on the LED screen",
"url":"/examples/plot-light-level", "url": "/examples/plot-light-level",
"cardType": "example" "cardType": "example"
}, { }, {
"name": "Plot Analog Pin", "name": "Plot Analog Pin",
"description": "Chart analog input on the LED screen", "description": "Chart analog input on the LED screen",
"url":"/examples/plot-analog-pin", "url": "/examples/plot-analog-pin",
"cardType": "example" "cardType": "example"
}, { }, {
"name": "Stop Watch", "name": "Stop Watch",
"description": "Easily track time", "description": "Easily track time",
"url":"/examples/stop-watch", "url": "/examples/stop-watch",
"cardType": "example" "cardType": "example"
}, { }, {
"name": "Radio Dashboard", "name": "Radio Dashboard",
"description": "A dashboard for radio clients", "description": "A dashboard for radio clients",
"url":"/examples/radio-dashboard", "url": "/examples/radio-dashboard",
"cardType": "example" "cardType": "example"
}] }]
``` ```
@ -80,7 +79,7 @@ Here are some fun programs for your @boardname@!
[{ [{
"name": "Servo Calibrator", "name": "Servo Calibrator",
"description": "Calibrate a servo", "description": "Calibrate a servo",
"url":"/examples/servo-calibrator", "url": "/examples/servo-calibrator",
"cardType": "example" "cardType": "example"
}] }]
``` ```
@ -91,17 +90,17 @@ Here are some fun programs for your @boardname@!
[{ [{
"name": "Turtle Square", "name": "Turtle Square",
"description": "Move in a square", "description": "Move in a square",
"url":"/examples/turtle-square", "url": "/examples/turtle-square",
"cardType": "example" "cardType": "example"
}, { }, {
"name": "Turtle Spiral", "name": "Turtle Spiral",
"description": "Move in a spiral", "description": "Move in a spiral",
"url":"/examples/turtle-spiral", "url": "/examples/turtle-spiral",
"cardType": "example" "cardType": "example"
}, { }, {
"name": "Turtle Scanner", "name": "Turtle Scanner",
"description": "Scan down the screen", "description": "Scan down the screen",
"url":"/examples/turtle-scanner", "url": "/examples/turtle-scanner",
"cardType": "example" "cardType": "example"
}] }]
``` ```

@ -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