355 posts
Posted 21 October 2012 - 08:05 AM
function f
turtle.forward() --this is line 65 Btw
end
f
f
f
Error:
bios: 328 : [string "sort" ]:65: '(' expected
Edit: My rank realy fits with this question.
318 posts
Location
Somewhere on the planet called earth
Posted 21 October 2012 - 08:07 AM
You name a function like this,
function funcName()
--Code to do
end
funcName()
8543 posts
Posted 21 October 2012 - 08:07 AM
The first thing you did wrong was not posting the whole code. The second thing you did wrong was not using parentheses in your function declaration, or your function calls.
function f()
turtle.forward()
end
f()
f()
f()
15 posts
Posted 21 October 2012 - 08:08 AM
function f
turtle.forward() --this is line 65 Btw
end
f
f
f
Error:
bios: 328 : [string "sort" ]:65: '(' expected
Edit: My rank realy fits with this question.
this is easy and hard
in function f() u forgot to add brackets and the variable to count how far forwards
the f needs bracks f()
function f(distance_var)
turtle.forward(distance_var)
end
f(2) -- 2 blocks
f(6) -- 6 blocks
lyqyd is a better answer
355 posts
Posted 21 October 2012 - 08:10 AM
And that is why I never use functions.
Thanks guys!
8543 posts
Posted 21 October 2012 - 08:11 AM
function f(distance_var)
turtle.forward(distance_var)
end
f(2) -- 2 blocks
f(6) -- 6 blocks
This is incorrect. turtle.forward() does not accept arguments.
355 posts
Posted 21 October 2012 - 08:18 AM
function f(distance_var)
turtle.forward(distance_var)
end
f(2) -- 2 blocks
f(6) -- 6 blocks
This is incorrect. turtle.forward() does not accept arguments.
Yes, when I tried that, it didnt work.
Btw, my giant system is coming along nicely.
Currently working on turtle 1 of 17, and 87 lines of code on him…
318 posts
Location
Somewhere on the planet called earth
Posted 21 October 2012 - 08:20 AM
Juste use a disk, to transfer code
15 posts
Posted 21 October 2012 - 08:25 AM
doesnt it accept arguments? oh well i rarely use turtles anyway thx for correcting me
355 posts
Posted 21 October 2012 - 08:31 AM
Juste use a disk, to transfer code
That wouldnt work because all the turtles do something different.
318 posts
Location
Somewhere on the planet called earth
Posted 21 October 2012 - 08:34 AM
Ohh. I guess you have to make it then.
Good luck
2005 posts
Posted 21 October 2012 - 12:00 PM
Use a disk to open the turtle to accept a file over rednet, and then have the central controller send it.
2088 posts
Location
South Africa
Posted 21 October 2012 - 12:03 PM
Would this work?
function f(distance_var)
for i = 1,distance_var do
turtle.forward()
end
end
f(2) -- 2 blocks
f(6) -- 6 blocks
8543 posts
Posted 21 October 2012 - 05:46 PM
Would this work?
function f(distance_var)
for i = 1,distance_var do
turtle.forward()
end
end
f(2) -- 2 blocks
f(6) -- 6 blocks
Yes, that would work, providing the turtle had fuel to move eight spaces.