Files
pythonmc/BookCraigRichardson/forLoops/pyramid.py
BarsTigerMeowcat 8bed7171c2 Initial commit
2020-01-26 12:49:01 +02:00

13 lines
353 B
Python

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