SHOW:
|
|
- or go back to the newest paste.
1 | - | q = 1 |
1 | + | |
2 | for x = 1 , dlina do | |
3 | - | turtle.select(q) |
3 | + | |
4 | turtle.select(2) | |
5 | end | |
6 | - | q = q + 1 |
6 | + | turtle.turnRight() |
7 | turtle.placeDown() | |
8 | turtle.turnLeft() | |
9 | - | turtle.placeDown() |
9 | + | turtle.forward() |
10 | end | |
11 | - | turtle.forward() |
11 | + | |
12 | ||
13 | function square(dlina) | |
14 | for b = 1, 4 do | |
15 | line(dlina) | |
16 | turtle.turnRight() | |
17 | end | |
18 | end | |
19 | ||
20 | function cube(length,height) | |
21 | for s = 1 , height do | |
22 | square(length) | |
23 | turtle.up() | |
24 | end | |
25 | end | |
26 | ||
27 | function pyramid(size) | |
28 | squareSize = size | |
29 | - | squareNum = math.ceil( size / 2 ) |
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 | ||
41 | - | turtle.select(5) |
41 | + | |
42 | - | pyramid(size) |
42 | + | turtle.select() |
43 | - | half = math.ceil( size / 2 ) |
43 | + | pyramid(size) |