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

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

View File

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