SHOW:
|
|
- or go back to the newest paste.
| 1 | n = 50 | |
| 2 | - | z = 4 |
| 2 | + | z = 3 |
| 3 | -------------------------------- | |
| 4 | function dig(n) | |
| 5 | sl = 2 | |
| 6 | for i=1,n do | |
| 7 | while turtle.detect() do | |
| 8 | turtle.dig() | |
| 9 | sleep(sl) | |
| 10 | end | |
| 11 | turtle.digUp() | |
| 12 | turtle.back() | |
| 13 | while turtle.detect() do | |
| 14 | turtle.dig() | |
| 15 | sleep(sl) | |
| 16 | end | |
| 17 | turtle.forward() | |
| 18 | turtle.digDown() | |
| 19 | turtle.forward() | |
| 20 | end | |
| 21 | end | |
| 22 | ||
| 23 | function just_dig(n) | |
| 24 | for i=1,n do | |
| 25 | turtle.dig() | |
| 26 | turtle.forward() | |
| 27 | end | |
| 28 | end | |
| 29 | -------------------------------- | |
| 30 | dig(n) | |
| 31 | -------------------------------- | |
| 32 | turtle.turnRight() | |
| 33 | just_dig(z) | |
| 34 | turtle.turnRight() | |
| 35 | -------------------------------- | |
| 36 | dig(n) |