fork download
  1. function table.map_length(t)
  2. local c = 0
  3. for k,v in pairs(t) do
  4. c = c+1
  5. end
  6. return c
  7. end
  8.  
  9. a = { move1 = "oi", move2 = "oi2"}
  10.  
  11. for x=1, table.map_length(a) do
  12. print(a["move" .. x])
  13. end
  14.  
  15. for k, v in pairs(a) do
  16. print(v)
  17. end
  18.  
  19. --https://pt.stackoverflow.com/q/38912/101
Success #stdin #stdout 0s 14112KB
stdin
Standard input is empty
stdout
oi
oi2
oi2
oi