Initial commit
This commit is contained in:
13
BookCraigRichardson/forLoops/pyramid.py
Normal file
13
BookCraigRichardson/forLoops/pyramid.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from mcpi.minecraft import Minecraft
|
||||
mc = Minecraft.create()
|
||||
|
||||
block = 24
|
||||
height = int(input("Введите высоту пирамиды "))
|
||||
levels = reversed(range(height))
|
||||
|
||||
pos = mc.player.getTilePos()
|
||||
x, y, z = pos.x + height, pos.y, pos.z
|
||||
|
||||
for level in levels:
|
||||
mc.setBlocks(x - level, y, z - level, x + level, y, z + level, block)
|
||||
y += 1
|
||||
Reference in New Issue
Block a user