Fix tutorial authoring for getting started (#885)

* Fix tutorial authoring for getting started

Remove extra new lines

* Fix other tutorials
This commit is contained in:
Sam El-Husseini 2018-06-21 16:02:19 -07:00 committed by GitHub
parent d7f9280dc7
commit 2e9cb3c43b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 35 additions and 38 deletions

View File

@ -8,26 +8,6 @@ Fun games to build with your @boardname@.
```codecard
[{
"name": "Flashing Heart",
"url":"/projects/flashing-heart",
"imageUrl": "/static/mb/projects/a1-display.png",
"cardType": "tutorial"
}, {
"name": "Smiley Buttons",
"url":"/projects/smiley-buttons",
"imageUrl": "/static/mb/projects/a2-buttons.png",
"cardType": "tutorial"
}, {
"name": "Coin Flipper",
"url":"/projects/coin-flipper",
"imageUrl": "/static/mb/projects/coin-flipper.png",
"cardType": "tutorial"
}, {
"name": "Love Meter",
"url":"/projects/love-meter",
"imageUrl":"/static/mb/projects/a3-pins.png",
"cardType": "tutorial"
}, {
"name": "Rock Paper Scissors",
"url":"/projects/rock-paper-scissors",
"imageUrl":"/static/mb/projects/a4-motion.png"

View File

@ -2,8 +2,7 @@
## Step 1
Place a ``||input:on button pressed||`` block to run code
when button **A** is pressed.
Place a ``||input:on button pressed||`` block to run code when button **A** is pressed.
```blocks
input.onButtonPressed(Button.A, () => {

View File

@ -2,8 +2,7 @@
## Step 1
Place the ``||basic:show leds||`` block in the ``||basic:on start||`` block
and draw a heart.
Place the ``||basic:show leds||`` block in the ``||basic:on start||`` block and draw a heart.
```blocks
basic.showLeds(`

View File

@ -4,8 +4,7 @@ Make a love meter, how sweet! The @boardname@ is feeling the love, then sometime
## Step 1
Let's build a **LOVE METER** machine. Place a ``||input:on pin pressed||`` block to run code
when pin ``P0`` is pressed.
Let's build a **LOVE METER** machine. Place a ``||input:on pin pressed||`` block to run code when pin ``P0`` is pressed.
```blocks
input.onPinPressed(TouchPin.P0, () => {
@ -13,8 +12,7 @@ input.onPinPressed(TouchPin.P0, () => {
```
## Step 2
Using ``||basic:show number||`` and ``||Math:pick random||`` blocks,
show a random number from 0 to 100 when pin ``P0`` is pressed.
Using ``||basic:show number||`` and ``||Math:pick random||`` blocks, show a random number from 0 to 100 when pin ``P0`` is pressed.
```blocks
input.onPinPressed(TouchPin.P0, () => {

View File

@ -11,8 +11,7 @@ input.onButtonPressed(Button.A, () => {
## Step 2
Place a ``||basic:show leds||`` block inside ``||input:on button pressed||``
to display a smiley on the screen.
Place a ``||basic:show leds||`` block inside ``||input:on button pressed||`` to display a smiley on the screen.
```blocks
input.onButtonPressed(Button.A, () => {
@ -32,8 +31,7 @@ Click ``|Download|`` to transfer your code in your @boardname@ and try pressing
## Step 4
Add ``||input:on button pressed||`` and ``||basic:show leds||`` blocks to
display a frowney when button **B** is pressed.
Add ``||input:on button pressed||`` and ``||basic:show leds||`` blocks to display a frowney when button **B** is pressed.
```blocks
input.onButtonPressed(Button.B, () => {
@ -53,8 +51,7 @@ Click ``|Download|`` to transfer your code in your @boardname@ and try pressing
## Step 6
Add a secret mode where ``A`` and ``B`` are pressed together.
In that case, add multiple ``||basic:show leds||`` blocks to create an animation...
Add a secret mode where ``A`` and ``B`` are pressed together. In that case, add multiple ``||basic:show leds||`` blocks to create an animation...
```blocks
input.onButtonPressed(Button.AB, () => {

View File

@ -13,4 +13,30 @@ Here are some cool tutorials to get you started with your @boardname@!
"labelClass": "red ribbon large tutorial",
"description": "Start coding your micro:bit with this simple tutorial."
}]
```
## Basic
```codecard
[{
"name": "Flashing Heart",
"url":"/projects/flashing-heart",
"imageUrl": "/static/mb/projects/a1-display.png",
"cardType": "tutorial"
}, {
"name": "Smiley Buttons",
"url":"/projects/smiley-buttons",
"imageUrl": "/static/mb/projects/a2-buttons.png",
"cardType": "tutorial"
}, {
"name": "Coin Flipper",
"url":"/projects/coin-flipper",
"imageUrl": "/static/mb/projects/coin-flipper.png",
"cardType": "tutorial"
}, {
"name": "Love Meter",
"url":"/projects/love-meter",
"imageUrl":"/static/mb/projects/a3-pins.png",
"cardType": "tutorial"
}]
```

View File

@ -48,13 +48,11 @@ input.onButtonPressed(Button.B, () => {
## Step 6
Place the ``||basic:show number||`` and ``||Math:pick random||`` blocks
in an ``||input:on shake||`` slot to build a dice.
Place the ``||basic:show number||`` and ``||Math:pick random||`` blocks in an ``||input:on shake||`` slot to build a dice.
###
When the @boardname@ is shaken, a random number between ``0`` and ``6`` is displayed
on the screen.
When the @boardname@ is shaken, a random number between ``0`` and ``6`` is displayed on the screen.
```blocks
input.onGesture(Gesture.Shake, () => {