<commit_before># Lesson 4 notes

#### Goal
Make a pyramid with layers

#### Code
Open up script.py in a code editor. Delete everything in it, we'll be starting from scratch!

```python
import mcpi.minecraft as minecraft
mc = minecraft.Minecraft.create(address="192.168.127.12", name="seanybob")
```
The first 2 lines are similar to the previous lesson. Be sure to replace "seanybob" with your name!

```
# Hint: Instead of thinking of the pyramid as one building, think of every layer of the pyramid as a separate building that is only 1 block high.

block = 24
# This is the block id for sandstone, which is good for a pyramid. 

#Get the player's current position so we can build the pyramid there.
pos = mc.player.getPos()
x = pos.x
y = pos.y
z = pos.z

x2 = x + 8 #Make it 8 blocks wide.
y2 = y + 0 #Make it only one block high, so don't add anything here.
z2 = z + 8 #Make it 8 blocks long.

mc.setBlocks(x, y, z, x2, y2, z2, block)

x = pos.x + 1
y = pos.y + 1 
z = pos.z + 1

x2 = x + 6 
z2 = z + 6 

mc.setBlocks(x, y, z, x2, y2, z2, block)

x = pos.x+2
y = pos.y+2 
z = pos.z+2

x2 = x + 4 
z2 = z + 4 

mc.setBlocks(x, y, z, x2, y2, z2, block)

x = pos.x + 3
y = pos.y + 3
z = pos.z + 3

x2 = x + 2
z2 = z + 2 

mc.setBlocks(x, y, z, x2, y2, z2, block)

x = pos.x + 4
y = pos.y + 4
z = pos.z + 4

x2 = x + 0
z2 = z + 0 

mc.setBlocks(x, y, z, x2, y2, z2, block)

```

######CHALLENGES FOR KIDS
- Make the pyramid hollow inside
- Make a house with a pyramid-like roof on top of it
- Make code that builds a giant tree (using wood and leaf blocks)<commit_msg>tweaks for clarity<commit_after># Lesson 4 notes

#### Goal
Make a pyramid with layers

#### Code
Open up script.py in a code editor. Delete everything in it, we'll be starting from scratch!

```python
import mcpi.minecraft as minecraft
mc = minecraft.Minecraft.create(address="192.168.127.12", name="seanybob")
```
The first 2 lines are similar to the previous lesson. Be sure to replace "seanybob" with your name!

```
# Hint: Instead of thinking of the pyramid as one building, think of every layer of the pyramid as a separate building that is only 1 block high.

block = 24
# This is the block id for sandstone, which is good for a pyramid. 

#Get the player's current position so we can build the pyramid there.
pos = mc.player.getPos()
x = pos.x
y = pos.y
z = pos.z

x2 = x + 8 #Make it 8 blocks wide.
# y2 = y 
z2 = z + 8 #Make it 8 blocks long.

mc.setBlocks(x, y, z, x2, y, z2, block)

x = pos.x + 1
y = pos.y + 1 
z = pos.z + 1

x2 = x + 6 
z2 = z + 6 

mc.setBlocks(x, y, z, x2, y, z2, block)

x = pos.x+2
y = pos.y+2 
z = pos.z+2

x2 = x + 4 
z2 = z + 4 

mc.setBlocks(x, y, z, x2, y, z2, block)

x = pos.x + 3
y = pos.y + 3
z = pos.z + 3

x2 = x + 2
z2 = z + 2 

mc.setBlocks(x, y, z, x2, y, z2, block)

x = pos.x + 4
y = pos.y + 4
z = pos.z + 4

x2 = x + 0
z2 = z + 0 

mc.setBlocks(x, y, z, x2, y, z2, block)

```

######CHALLENGES 
- Make the pyramid hollow inside (just talk it through, don't do it)
- Make a house with a pyramid-like roof on top of it
- Make code that builds a giant tree (using wood and leaf blocks)
{'fraction_non_alphanumeric': 0.1250402835965195, 'fraction_numerical': 0.0412504028359652, 'mean_word_length': 2.914249684741488, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5375513', 'n_tokens_mistral': 1343, 'n_tokens_neox': 1216, 'n_words': 530}