print("X: ")
x = tonumber(io.read())
print("Z: ")
z = tonumber(io.read())
print("Direction: +x(E)=0 +z(S)=1 -x(W)=2 -z(N)=3")
dir = tonumber(io.read())
aturtle.resetPosition(x, 0, z, dir)

newX = math.floor(x / 16) * 16 + 8
newZ = math.floor(z / 16) * 16 + 8
print("Current pos " .. x .. ", " .. z)
print("Moving to " .. newX .. ", " .. newZ)

aturtle.moveTo(newX, 0, newZ, dir, true, nil, function()
	turtle.digUp()
end)

