Say I had number a, which was 30, and number b, which was 35.
How would I get all the numbers between, so, a function that would return 30, 31, 32, 33, 34, 35 ?
Thanks.
[lua]
function GetBetween(Start,End)
local Numbers = {}
local WeAreAt = 0
for i=Start,End do
Numbers[WeAreAt] = i
WeAreAt++
end
return Numbers
end
[/lua]
Im learning lua so please post optimations
Good, it works
Edit:
Just as you know printtable print indexes in a wierd order :P
[QUOTE=hansihe;21672888][lua]WeAreAt++[/lua][/QUOTE]
You can't do that in Lua
[editline]08:03PM[/editline]
[lua]function GetBetween(start, endn)
local n = {}
for i=start, endn do
table.insert(n, i)
end
return n
end[/lua]
*Scrambling that in my headluadatabase*
Sorry, you need to Log In to post a reply to this thread.