Turtle tutorial step text continuity (#1514)

This commit is contained in:
Galen Nickel 2018-10-24 12:02:31 -07:00 committed by GitHub
parent 43500c7390
commit 8c6c5cf60b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 15 deletions

View File

@ -2,12 +2,11 @@
## Introduction @unplugged ## Introduction @unplugged
Imagine that a virtual turtle, as big as an LED, that you can control it with commands. Imagine that there's a virtual turtle, as small as an LED, that you can control with commands. In this tutorial, you will learn to use the turtle and draw a square.
In this tutorial, you will learn to use the turtle and draw a square.
## Moving the turtle @fullscreen ## Moving the turtle @fullscreen
The turtle starts in the center of the screen facing up. Place a ``||turtle:forward||`` block to make it move up. The turtle starts in the center of the screen heading upward. Place a ``||turtle:forward||`` block to make it move up.
```blocks ```blocks
turtle.forward(1) turtle.forward(1)
@ -25,10 +24,9 @@ turtle.forward(1)
## Drawing a square ## Drawing a square
If you add enough ``||turtle:turnRight||`` and ``||turtle:forward||`` block, the turtle If you add enough ``||turtle:turnRight||`` and ``||turtle:forward||`` blocks, the turtle will eventually draw a square.
will eventually draw a square.
You can move the blocks in a ``||input:on button pressed||`` to easily run the code again. You can move the blocks into a ``||input:on button pressed||`` to easily run the code again.
```blocks ```blocks
input.onButtonPressed(Button.A, function() { input.onButtonPressed(Button.A, function() {
@ -43,10 +41,9 @@ input.onButtonPressed(Button.A, function() {
}) })
``` ```
## "For" is for repetition ## "for" is for repetition
Have you notice the repetition pattern in the blocks needed to draw a square? Did you notice the pattern of repeated blocks needed to draw a square? Try using a ``for`` loop to achieve the same effect.
Try to use a ``for`` loop to achieve the same effect.
```blocks ```blocks
input.onButtonPressed(Button.A, function() { input.onButtonPressed(Button.A, function() {
@ -57,11 +54,9 @@ input.onButtonPressed(Button.A, function() {
}) })
``` ```
## Leaving a trail ## Leaving a trail
The turtle holds a pen that turns on LEDs. If you add the ``||turtle:pen||`` block, The turtle holds a **pen** that can turn on LEDs. If you add the ``||turtle:pen||`` block, it will leave a trail as the turtle moves.
it will leave a trail as it moves.
```blocks ```blocks
input.onButtonPressed(Button.A, function() { input.onButtonPressed(Button.A, function() {

View File

@ -7,19 +7,19 @@ Turtle graphics on your @boardname@ screen!
```codecard ```codecard
[{ [{
"name": "Square", "name": "Square",
"description": "Move in a square", "description": "Move the turtle in a square pattern.",
"url": "/projects/turtle-square", "url": "/projects/turtle-square",
"imageUrl":"/static/mb/projects/turtle-square.png", "imageUrl":"/static/mb/projects/turtle-square.png",
"cardType": "tutorial" "cardType": "tutorial"
}, { }, {
"name": "Spiral", "name": "Spiral",
"description": "Move in a spiral", "description": "Move the turtle in a spiral.",
"url": "/projects/turtle-spiral", "url": "/projects/turtle-spiral",
"imageUrl":"/static/mb/projects/turtle-spiral.png", "imageUrl":"/static/mb/projects/turtle-spiral.png",
"cardType": "side" "cardType": "side"
}, { }, {
"name": "Scanner", "name": "Scanner",
"description": "Scan down the screen", "description": "Let the turtle scan across and down the screen.",
"url": "/projects/turtle-scanner", "url": "/projects/turtle-scanner",
"imageUrl":"/static/mb/projects/turtle-scanner.png", "imageUrl":"/static/mb/projects/turtle-scanner.png",
"cardType": "side" "cardType": "side"