Fix Turtle Spiral example decompilation (#2094)

* use local variables for indices

* s/an/the/
This commit is contained in:
Joey Wunderlich 2019-05-30 16:15:38 -07:00 committed by GitHub
parent f0e174a4f3
commit 65a05bf2d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@
## Setting up your project ## Setting up your project
This project uses an **microturtle** Extension. You'll need to add it to your project to make it work. This project uses the **microturtle** Extension. You'll need to add it to your project to make it work.
* create a new project * create a new project
* click on the gearwheel menu and click **Extensions** * click on the gearwheel menu and click **Extensions**
@ -15,15 +15,14 @@ After the project reloads, you should see the **turtle** category in the blocks.
A turtle that spirals into the center of the display and back out again. A turtle that spirals into the center of the display and back out again.
```blocks ```blocks
let index = 0
turtle.setPosition(0, 0) turtle.setPosition(0, 0)
turtle.turnRight() turtle.turnRight()
basic.forever(() => { basic.forever(() => {
for (index = 0; index <= 4; index++) { for (let index = 0; index <= 4; index++) {
turtle.forward(4 - index) turtle.forward(4 - index)
turtle.turnRight() turtle.turnRight()
} }
for (index = 0; index <= 4; index++) { for (let index = 0; index <= 4; index++) {
turtle.turnLeft() turtle.turnLeft()
turtle.back(index) turtle.back(index)
} }