View difference between Paste ID: kWmb5gfx and Tzva9xrb
SHOW: | | - or go back to the newest paste.
1
q = 1 
2
function line(dlina)
3-
		if turtle.getItemCount = 0 do
3+
	turtle.select(q)
4-
			turtle.select(2)
4+
5
		if turtle.getItemCount() == 0 then
6
			q = q + 1
7
		end
8
		turtle.turnRight()
9
 		turtle.placeDown()
10
		turtle.turnLeft()
11
 		turtle.forward()
12
 	end
13
end
14
function square(dlina)
15
	for b = 1, 4 do
16
		line(dlina)
17
		turtle.turnRight()
18
	end	
19
end
20-
		
20+
21
	for s = 1 , height do
22
		square(length)
23-
cube(7,3)
23+
24
	end
25
end
26
27
function pyramid(size)
28
	squareSize = size
29
	squareNum = math.ceil( size / 2 )
30
	for y = 1, squareNum do
31
		square(squareSize)
32
		turtle.forward()
33
		turtle.turnRight()
34
		turtle.up()
35
		turtle.forward()
36
		turtle.turnLeft()
37
		squareSize = squareSize - 2
38
	end
39
end
40
function roof(size)
41
	turtle.select(5)
42
	pyramid(size)
43
	half = math.ceil( size / 2 )
44
	for x = 1, half do
45
		turtle.back()
46
	end
47
	turtle.turnLeft()
48
	for x = 1, half do
49
		turtle.forward()
50
	end
51
	turtle.turnRight()
52
	for x = 1, half - 1 do
53
		turtle.down()
54
	end
55
	turtle.select(6)
56
	pyramid(size)
57
end
58
length = math.random(3, 7)
59
roof(length)
60
function house()
61
	cube()
62
	pyramid(size)
63
	roof(size)
64
end
65