-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from CausewayDigital/master
Computing with Minecraft bug fixes
- Loading branch information
Showing
9 changed files
with
62 additions
and
86 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,63 @@ | ||
### @explicitHints 1 | ||
|
||
# Lesson 1: Code a Park Fence | ||
|
||
## Step 1 | ||
Rename the **run** element of the ``||Player:on chat command||`` block to **park_fence**. | ||
|
||
Drag and drop the ``||Agent:agent set active slot||`` code block to the coding Workspace and add it to your ``||Player:on chat command||`` code block. | ||
|
||
Drag and drop the ``||Agent:agent move [forward]||`` code block to the coding Workspace and add it to your ``||Player:on chat command||`` code block. Change **forward** to **up**. | ||
|
||
#### ~ tutorialhint | ||
### ~ tutorialhint | ||
``` blocks | ||
player.onChat("park_fence", function () { | ||
agent.setSlot(1) | ||
agent.move(UP, 1) | ||
}) | ||
``` | ||
## Step 2 | ||
Drag the ``||Loops:repeat [4] times||`` into your ``||Player:on chat command||`` set and change it to **2**. | ||
Drag the ``||Loops:repeat [4] times||`` into your ``||Player:on chat command||`` set and change it to **25**. | ||
|
||
#### ~ tutorialhint | ||
### ~ tutorialhint | ||
``` blocks | ||
player.onChat("park_fence", function () { | ||
agent.setSlot(1) | ||
agent.move(UP, 1) | ||
for (let index = 0; index < 2; index++) { | ||
for (let index = 0; index < 25; index++) { | ||
} | ||
}) | ||
``` | ||
|
||
## Step 3 | ||
Drag the ``||Agent:agent move [forward]||`` code block to the coding Workspace, add it to your ``||Player:on chat command||`` code block, inside the ``||Loops:repeat [2] times||`` loop, then set it to our first number, **25**. | ||
Drag the ``||Agent:agent move [forward]||`` code block to the coding Workspace, add it to your ``||Player:on chat command||`` code block, inside the ``||Loops:repeat [25] times||`` loop, then set it to **1**. | ||
|
||
Drag the ``||Agent:agent place [forward]||`` code block to the coding Workspace, add it to your ``||Player:on chat command||`` code block, inside the ``||Loops:repeats [2] times||`` loop, under the ``||Agent.agent move[forward]||`` code block, then change **forward** to **down**. | ||
Drag the ``||Agent:agent place [forward]||`` code block to the coding Workspace, add it to your ``||Player:on chat command||`` code block, inside the ``||Loops:repeats [25] times||`` loop, under the ``||Agent.agent move[forward]||`` code block, then change **forward** to **back**. | ||
|
||
#### ~ tutorialhint | ||
### ~ tutorialhint | ||
``` blocks | ||
player.onChat("park_fence", function () { | ||
agent.setSlot(1) | ||
agent.move(UP, 1) | ||
for (let index = 0; index < 2; index++) { | ||
agent.move(FORWARD, 25) | ||
agent.place(DOWN) | ||
for (let index = 0; index < 25; index++) { | ||
agent.move(FORWARD, 1) | ||
agent.place(BACK) | ||
} | ||
}) | ||
``` | ||
|
||
## Step 4 | ||
Drag the ``||Agent:agent turn [left]||`` code block to your ``||PLayer:on chat command||`` code block, inside the ``||Loops:repeat [2] times||`` and set it to the direction your Agent needs to turn. In our example, this is **left**. | ||
Drag the ``||Agent:agent turn [left]||`` code block to your ``||PLayer:on chat command||`` code block after the loop. Set it to the direction your Agent needs to turn. In our example, this is **left**. | ||
|
||
#### ~ tutorialhint | ||
### ~ tutorialhint | ||
``` blocks | ||
player.onChat("park_fence", function () { | ||
agent.setSlot(1) | ||
agent.move(UP, 1) | ||
for (let index = 0; index < 2; index++) { | ||
agent.move(FORWARD, 25) | ||
agent.place(DOWN) | ||
agent.turn(LEFT_TURN) | ||
for (let index = 0; index < 25; index++) { | ||
agent.move(FORWARD, 1) | ||
agent.place(BACK) | ||
} | ||
agent.turn(LEFT_TURN) | ||
}) | ||
``` | ||
|
||
## Step 5 | ||
Drag the ``||Agent:agent move [forward]||`` code block to your ``||Player:on chat command||`` code block, then set it to our second number, **23**. | ||
|
||
Drag the ``||Agent:agent place[forward]||`` code block in your ``||Player:on chat command||`` code block, change **forward** to **down**. | ||
|
||
#### ~ tutorialhint | ||
``` blocks | ||
player.onChat("park_fence", function () { | ||
agent.setSlot(1) | ||
agent.move(UP, 1) | ||
for (let index = 0; index < 2; index++) { | ||
agent.move(FORWARD, 25) | ||
agent.place(DOWN) | ||
agent.turn(LEFT_TURN) | ||
agent.move(FORWARD, 23) | ||
agent.place(DOWN) | ||
} | ||
}) | ||
``` | ||
|
||
## Step 6 | ||
Drag one more ``||Agent:agent turn [left]||`` code block to your ``||Player:on chat command||`` code block inside the **loop** and leave it set to **left**. | ||
|
||
#### ~ tutorialhint | ||
``` blocks | ||
player.onChat("park_fence", function () { | ||
agent.setSlot(1) | ||
agent.move(UP, 1) | ||
for (let index = 0; index < 2; index++) { | ||
agent.move(FORWARD, 25) | ||
agent.place(DOWN) | ||
agent.turn(LEFT_TURN) | ||
agent.move(FORWARD, 23) | ||
agent.place(DOWN) | ||
agent.turn(LEFT_TURN) | ||
} | ||
}) | ||
``` | ||
|
||
## Step 7 | ||
Test your code. Place your Agent on the starting block and run your code by pressing **T** to open the chat box and type **park_fence**. | ||
|
||
This code will only do one side at a time. Make sure your agent has enough blocks to finish each side before you run! Ask the Unit 3 Lesson 1 NPC for more blocks if you need them. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters