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

[question] for loop with a variable?

Started by mrQubeMaster, 21 September 2012 - 01:38 PM
mrQubeMaster #1
Posted 21 September 2012 - 03:38 PM
is it possible to put a variable in a for loop like this:


  input = read()
  for i= 1.input do
   wall
  end

or is there a other way to do this?

SOLVED :)/>/>
ChiknNuggets #2
Posted 21 September 2012 - 03:42 PM
From what i understand from your post you want this

input = read()
  for i= 1,tonumber(input) do
   wall()
end
mrQubeMaster #3
Posted 21 September 2012 - 05:02 PM
From what i understand from your post you want this

input = read()
  for i= 1,tonumber(input) do
   wall()
end
well i got an error when i used the code above but the problem was that i had wall instead of wall()
but thanx