Posted 26 September 2012 - 03:41 AM
Hello people i was trying to make my program but i have run into an error when i try to execute my code i get the following… Bios:26: [string "dig"]:37: '=' expected
this is my code:
local x –Current pos on x axis
local y –Current pos on the y axis
local z –Current pos on the z axis
local startX –position that the robot will begin to mine(on the x coordinate.)
local startY –height that the robot will begin to mine.
local startZ –same as startX but for the z position.
local xDiff –How many blocks in the X direction
local yDiff –How many blocks in the y direction
local zDiff –How many blocks in the z direction
local i = 1
term.clear()
term.setCursorPos(1,1)
write("What Is My x Position? ")
x = read()
write("What Is My y Position? ")
y = read()
write("What Is My z Position? ")
z = read()
write("Where Do You Want Me To Begin?(X) ")
startX = read()
write("Where Do You Want Me To Begin?(Y) ")
startY = read()
write("Where Do You Want Me To Begin?(Z) ")
startZ = read()
xDiff = startX - x
yDiff = startY - y
zDiff = startZ - z
repeat
turtle.forward()
xDiff = xDiff + 1
untill xDiff == startX
this is my code:
local x –Current pos on x axis
local y –Current pos on the y axis
local z –Current pos on the z axis
local startX –position that the robot will begin to mine(on the x coordinate.)
local startY –height that the robot will begin to mine.
local startZ –same as startX but for the z position.
local xDiff –How many blocks in the X direction
local yDiff –How many blocks in the y direction
local zDiff –How many blocks in the z direction
local i = 1
term.clear()
term.setCursorPos(1,1)
write("What Is My x Position? ")
x = read()
write("What Is My y Position? ")
y = read()
write("What Is My z Position? ")
z = read()
write("Where Do You Want Me To Begin?(X) ")
startX = read()
write("Where Do You Want Me To Begin?(Y) ")
startY = read()
write("Where Do You Want Me To Begin?(Z) ")
startZ = read()
xDiff = startX - x
yDiff = startY - y
zDiff = startZ - z
repeat
turtle.forward()
xDiff = xDiff + 1
untill xDiff == startX