SHOW:
|
|
- or go back to the newest paste.
1 | - | function room(x,y,z) |
1 | + | even = false |
2 | - | even = false |
2 | + | function room(x,y) |
3 | - | for i = 1,z do |
3 | + | lastpass = false |
4 | - | for j = 1,y do |
4 | + | for j = 1,y-1 do |
5 | - | for k = 1, x do |
5 | + | for k = 1, x do |
6 | turtle.dig() | |
7 | - | turtle.forward() |
7 | + | turtle.forward() |
8 | end | |
9 | if j == y-1 then | |
10 | - | turtle.turnRight() |
10 | + | turtle.turnLeft() |
11 | - | turtle.forward() |
11 | + | turtle.turnLeft() |
12 | - | turtle.turnRight() |
12 | + | lastpass = true |
13 | - | even = true |
13 | + | |
14 | if lastpass == false then | |
15 | if even== false then | |
16 | - | turtle.turnLeft() |
16 | + | turtle.turnRight() |
17 | - | turtle.forward() |
17 | + | |
18 | - | turtle.turnLeft() |
18 | + | turtle.forward() |
19 | turtle.turnRight() | |
20 | - | end |
20 | + | |
21 | even = true | |
22 | - | turtle.digDown() |
22 | + | |
23 | - | turtle.down() |
23 | + | turtle.turnLeft() |
24 | - | end |
24 | + | |
25 | turtle.forward() | |
26 | - | |
26 | + | turtle.turnLeft() |
27 | turtle.dig() | |
28 | even = false | |
29 | end | |
30 | end | |
31 | end | |
32 | end | |
33 | - | |
33 | + | |
34 | - | room(x,y,z) |
34 | + | function down() |
35 | turtle.digDown() | |
36 | turtle.down() | |
37 | end | |
38 | ||
39 | write("How long do you want the room to be? ") | |
40 | local x = read() | |
41 | write("How wide do you want the room to be? ") | |
42 | local y = read() | |
43 | write("How deep do you want the room to be? ") | |
44 | local z = read() | |
45 | ||
46 | for a = 1,z do | |
47 | room(x,y) | |
48 | down(z) | |
49 | end |