View difference between Paste ID: 8hQi2sZq and QPtDMjNA
SHOW: | | - or go back to the newest paste.
1
input = {...}
2
-- x, y, and then z
3-
for i = 1, input[3] do
3+
width = input[1]
4-
  for i = 1, input[2] do
4+
depth = input[2]
5-
    for i = 1, input[1] do
5+
height = input[3]
6-
    turtle.dig()
6+
startdir = 0
7-
    turtle.forward()
7+
dir = 0
8-
    end
8+
9-
  turtle.digUp()
9+
function turnright()
10-
  turtle.turnLeft()
10+
turtle.turnRight()
11-
  turtle.turnLeft()
11+
dir = dir + 1
12-
  end
12+
if dir > 4 then
13
	dir = 0
14
	end
15
end
16
17
function turnleft()
18
turtle.turnLeft()
19
dir = dir - 1
20
if dir < 0 then
21
	dir = 4
22
	end
23
end
24
25
for i = 1, height do
26
	for i = 1, width do
27
		for i = 1, depth - 1 do
28
			turtle.dig()
29
			turtle.forward()
30
			end
31
32
	turnright()	
33
	turnright()
34
35
		for i = 1, depth - 1 do
36
			turtle.forward()
37
			end
38
39
	if i ~= tonumber(width) then
40
		turnleft()
41
		turtle.dig()
42
		turtle.forward()
43
		turnleft()
44
		end
45
	end
46
47
--Height loop kicks in here.
48
49
turnright()
50
turnright()
51
turnleft() -- Does a little dance, I like it so I'm leaving it.
52
53
	for i = 1, width do
54
		turtle.forward()
55
	end
56
57
turnright()
58
59
	if i ~= tonumber(height) then
60
		turtle.digUp()
61
		turtle.up()
62
		else
63
			for i = 1, height do
64
				turtle.down()
65
			end
66
	end
67
end