Looping over array values in Lua
The idiomatic way to iterate over an array is: for _, armyName in ipairs(armies) do doStuffWithArmyName(armyName) end Note that: Use ipairs over pairs for arrays If the key isn’t what you are interested, use _ as placeholder. If, for some reason, that _ placeholder still concerns you, make your own iterator. Programming in Lua provides … Read more