This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
virtualnoodles's profile picture

[error] help with program

Started by virtualnoodles, 19 June 2012 - 03:24 AM
virtualnoodles #1
Posted 19 June 2012 - 05:24 AM
ok, so im just starting with this and i made a very simple program that i named "run". It fills in an area while also practicing with functions.
The code that i wrote reads as this:



go() = function()
turtle.forward()
end
low = function()
turtle.down()
end
put = function()
turtle.placeDown()
end
up = function()
turtle.up()
end
left = function()
turtle.turnLeft()
end
row = function()
x = 0
while x < 18 do
go()
put()
x = x + 1
end

low()
row()
x = x - 18
go()
put()
left()
go()
put()
left()
row()
x = x - 18
up()
go()
left()
go()
left()



Now, my problem is that an error pops up saying bios:206: [string "run"] :1: unexpected symbol.

any ideas?
i've looked over it again and again and can't figure it out.
it's a pretty simple code and it shouldn't be this hard but i can't figure it out.
please help.
BigSHinyToys #2
Posted 19 June 2012 - 07:20 AM
found the bugs


go = function()  -- removed () from go()
    turtle.forward()
end
low = function()
    turtle.down()
end
put = function()
    turtle.placeDown()
end
up = function()
    turtle.up()
end
left = function()
    turtle.turnLeft()
end
row = function()
    x = 0
    while x < 18 do
    go()
    put()
    x = x + 1
    end
end -- added end
low()
row()
x = x - 18
go()
put()
left()
go()
put()
left()
row()
x = x - 18
up()
go()
left()
go()
left()