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

how i can see amount of repeated loops?

Started by hopeless, 12 May 2012 - 05:23 PM
hopeless #1
Posted 12 May 2012 - 07:23 PM
i have loop in my program that repeats 5times how i can get it to print how many times it have repeated?
here is my loop:
x=5
while x>0 do
-stuff-
x=x-1
end
-more stuff-
hopeless #2
Posted 12 May 2012 - 07:42 PM
i found a way. delete this post
PixelToast #3
Posted 13 May 2012 - 11:49 PM
rename the title to solved, so nobody reads it
Lyqyd #4
Posted 14 May 2012 - 12:41 AM
It's better to post the solution so that others can find it and not have to ask the same question again.
ComputerCraftFan11 #5
Posted 14 May 2012 - 03:04 AM
It's better to post the solution so that others can find it and not have to ask the same question again.

Here is a solution:

for i=1,10 do
  print("Loading " ..i.. "/10")
end