Skip to content

Instantly share code, notes, and snippets.

@RobinStamer
Created March 15, 2013 11:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobinStamer/5169204 to your computer and use it in GitHub Desktop.
Save RobinStamer/5169204 to your computer and use it in GitHub Desktop.
dig.lua for a ComputerCraft Turtle
local t = turtle
local d = 32
function line(size)
local i = 0
while i < size do
if t.forward() then
i = i + 1
end
while (size > i) and (t.detect()) do
t.dig()
end
end
t.turnRight()
end
function plane(size)
line(size)
for i = 0, size - 1 do
line(size - i)
line(size - i)
end
end
function rplane(size)
for i = 1, size do
line(i)
line(i)
end
line(size)
end
plane(d)
t.digDown()
t.down()
rplane(d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment