Take a look at the following code sample which loops through a simple list:

myList = {1,2,3}
for i,v in ipairs(myList) do
	print(`v)
end

this outputs: 1 , 2 and 3. the reverse order print of this would be 3, 2, 1.

Is it possible, in LUA, to get the reversed output WITHOUT reversing myList and without using for i, #myList do loop? Is there a reverseIPairs() function or something like that?

5 comments

0
0

No... that is reversing the waypoints and then looping over this same reversed set. I don't want to reverse my waypoints, I want to access them in a reverse order... The difference is in the first approach you need to reverse, then go over each element, and in the second, you don't need to reverse - you just iterate in reverse order - so more efficient.

0

I don't rlly see the problem, it all happends so fast you wouldn't notice the difference

0

I have a very very very big list... :(

0

dang