Tho I can use " for i = [number],[number] do ", I still don’t know its meaning smoothly.
What does “i” refer to?
Tho I can use " for i = [number],[number] do ", I still don’t know its meaning smoothly.
What does “i” refer to?
Basically it is a loop in ranged.
Example: for i=1, 10 do
“i” will started from 1 and increase by 1 everytime until it reached 10.
That is how i understand it.
Why will it increase by 1 everytime? Why doesn’t it increase by 2 for example?
It is default as 1 cuz not everyone take effort to set it.
If you want to increase by 2 write "for i = 1, 10 , 2 do
It is like this for i = “Starter number”, “Goal number”, “Number increase every loop” do
Aha I get it.
Thank you so much:)
it doesn’t have to be i
it could be whatever (except non strings)
e.g
for gh = 10, 0, -1 do
end
--gh is i
Oh, so it is just a loop, but " i " is a common used variable in this loop, right?
yup, people use i because it is easy to remember as short for index
Ah, I get it.
Thank you mate:)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.