Jump to content




User friendly input variables


1 reply to this topic

#1 tysciman7

  • Members
  • 41 posts

Posted 28 January 2013 - 01:28 PM

I want to have something do something for a crtain amount of times that i tell it to do
for example i want to make a new turtle program to make it move a number of times i tell it to go and i dont want to have to edit the program everytime so one time ill say do something 3 times and at another time i tell it to do that same thing 5 times

#2 NeverCast

  • Members
  • 400 posts
  • LocationChristchurch, New Zealand

Posted 28 January 2013 - 01:32 PM

local args = { ... }
local times = tonumber(args[1])
for i = 1, times do
  turtle.forward()
end

Save it as cool

Type cool 10
in to the computer.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users