Professional Documents
Culture Documents
Echo Opo
Echo Opo
local run = 0
for i = 1, run do
digIt()
turtle.turnLeft()
digIt()
turtle.turnRight()
turtle.turnRight()
turtle.forward()
digIt()
turtle.turnLeft()
turtle.turnLeft()
turtle.forward()
turtle.turnRight()
end
function placeTorch()
turtle.back()
turtle.turnLeft()
turtle.select(16)
turtle.place()
turtle.turnRight()
turtle.forward()
end
local run = 0
local j = 0
local k = 0
for i = 1, run do
k = i - 1
j = k % 7
if j == 1 then
placeTorch()
end
digIt()
end
printIntegerArray(spiralArray);
}
int currentNumber = 1;
int top = 0;
int bottom = squareSideSize - 1;
int left = 0;
int right = squareSideSize - 1;
return matrix;
}
function digIt()
while turtle.detect() do
turtle.dig()
os.sleep(0.5)
end
turtle.forward()
while turtle.detectUp() do
turtle.digUp()
end
end
local run = 0
term.write("Tunnel length: ")
run = read()
for i = 1, run do
digIt()
turtle.turnLeft()
digIt()
turtle.turnRight()
turtle.turnRight()
turtle.forward()
digIt()
turtle.turnLeft()
turtle.turnLeft()
turtle.forward()
turtle.turnRight()
end
local run = 0
for i = 1, run do
digIt()
turtle.turnLeft()
digIt()
turtle.turnRight()
turtle.turnRight()
turtle.forward()
digIt()
turtle.turnLeft()
turtle.turnLeft()
turtle.forward()
turtle.turnRight()
end
function placeTorch()
turtle.back()
turtle.turnLeft()
turtle.select(16)
turtle.place()
turtle.turnRight()
turtle.forward()
end
local run = 0
local j = 0
local k = 0
for i = 1, run do
k = i - 1
j = k % 7
if j == 1 then
placeTorch()
end
digIt()
end
print("Returning to start...")
for i = 1, run do
turtle.back()
end
function placeTorch()
turtle.back()
turtle.turnLeft()
turtle.select(16)
turtle.place()
turtle.turnRight()
turtle.forward()
end
local run = 0
local j = 0
local k = 0
for i = 1, run do
k = i - 1
j = k % 7
if j == 1 then
placeTorch()
end
digIt()
end
public static void printIntegerArray(int[][] array) {
int maxElement = getArrayMaxElement(array);
int maxNumberLength = String.valueOf(maxElement).length();
return maxElement;
}
}