# ComputerCraft | Programmable Computers for Minecraft

»

## seigfried1327 Jan 2013

Hello, I am new to the forums an relatively new to coding. I have some amount of experience with logic statements in general and have some familiarity with code syntax.

In my SMP server I am currently trying to hollow out a roughly 8x8 chunk mountain that is probably 10+ chunks high. On top of that I intend to line the interior surface with a block of my choosing. After spending some time using quarries and manually chiseling the interior contours, I have set out to design a turtle script to help me accomplish at least part of my task. Upon brainstorming how it would work I touched upon using a series of turtles all connected to a rednet server machine of sorts to have workers mapping out the outer contour of the mountain and workers inside reading this contour and mining appropriately. I quickly realized how over my head that would be and settled for starting small.

My current prospective program is one that would run on one mining turtle.
With T being the turtle and X being the mountain blocks,

```    X
X X
X   X
TX     X
```

the turtle will keep track of elevation and traverse the mountain, storing elevation for each position in an array. Upon reaching elevation 0 again, it will know to stop, turn 180 degrees and burrow in to mountain to begin lining the interior.

This is where I run in to trouble. If the slopes were all simple 1x1 stair steps, I wouldn't have a problem with simply subtracting the stored elevation with a current turtle elevation to dig and place a block under the shell block, but patterns like:

```   X
XX
```

and

``` X
X
X
```

throw me off. Does anyone have any suggestions on an algorithm that would properly contract the voxel radius? Or even a better way of going about this project?

I had originally hoped for some way to sense more than one block in front of turtle so that I could simply mine forward until two blocks in front = air, then appropriately turn around and mine back the other way on the next row.

EDIT: Thanks for the split, edited the formatting of my diagrams
Edited by seigfried13, 27 January 2013 - 02:08 PM.
Reason for edit:: added code tags for ascii art

## Lyqyd27 Jan 2013

Split into new topic.

## crazyguymgd27 Jan 2013

So to think about this, I broke up the shape of the shell into each possible case, similar to what you were asking about. These cases (without overhangs) should be:

```xx
t
y1 == y2
z1 < z2
forward

x
x
t
y1 < y2
z1 < z2
forward, up

tx
x
y1 > y2
z1 < z2
down, forward

x
xt
y1 < y2
z1 == z2
up

tx
x
y1 > y2
z1 == z2
down
```

If I think of any others, I'll add them and if I think of any mistakes, I'll fix them. But from what you say you've done so far, I think you might be able to figure out how to use these rules to get the turtle to traverse the inside of the shell. If not, I'm working on testing this right now because I think this is a pretty cool problem so I can help you out based on what I discover in my tests.