SHOW:
|
|
- or go back to the newest paste.
1 | local robot = require("robot") | |
2 | local comp = require("computer") | |
3 | ||
4 | - | -- vsya dlina polya pered robotom |
4 | + | |
5 | - | local vper = 10 |
5 | + | robot.forward() |
6 | - | -- vsya shirina polya |
6 | + | for y=1, 15 do |
7 | - | local shir = 5 |
7 | + | |
8 | robot.useDown() | |
9 | robot.useUp() | |
10 | - | -- Vhod na pole |
10 | + | |
11 | - | robot.forward() |
11 | + | |
12 | - | -- po shirine |
12 | + | for x=1, 15 do |
13 | - | for y=1, (shir-1) do |
13 | + | |
14 | robot.useDown() | |
15 | robot.useUp() | |
16 | robot.suck() | |
17 | robot.suck() | |
18 | end | |
19 | - | for x=1, (vper-1) do |
19 | + | |
20 | --esli y nechetnoe to | |
21 | if y%2 == 1 then | |
22 | robot.turnLeft() | |
23 | robot.forward() | |
24 | robot.turnLeft() | |
25 | else | |
26 | robot.turnRight() | |
27 | robot.forward() | |
28 | robot.turnRight() | |
29 | end | |
30 | end | |
31 | -- na posledneij linii | |
32 | robot.useDown() | |
33 | robot.useUp() | |
34 | robot.suck() | |
35 | robot.suck() | |
36 | for x=1, 15 do | |
37 | robot.forward() | |
38 | robot.useDown() | |
39 | - | for x=1, (vper-1) do |
39 | + | |
40 | robot.suck() | |
41 | robot.suck() | |
42 | end | |
43 | -- vozvrat | |
44 | robot.turnLeft() | |
45 | while robot.detect()==false do | |
46 | robot.forward() | |
47 | - | if shir%2 == 1 then |
47 | + | |
48 | - | robot.turnRight() |
48 | + | |
49 | - | while robot.detect()==false do |
49 | + | |
50 | - | robot.forward() |
50 | + | |
51 | - | end |
51 | + | |
52 | - | robot.turnRight() |
52 | + | |
53 | for c = 1, 32 do | |
54 | robot.select(c) | |
55 | robot.dropDown() | |
56 | - | else |
56 | + | |
57 | end | |
58 | end | |
59 | ||
60 | while true do | |
61 | - | robot.turnRight() |
61 | + | |
62 | - | robot.forward() |
62 | + | |
63 | print('sleep') | |
64 | os.sleep(1800) | |
65 | end |