So I decide to print off the whole table, which is a 2D map ( map[x][y] = value )
I used a for loop to print off each value.
But certain numbers are always on the list twice(Never beside each other though, such as:
number 40 number 26 Dirt
number 40 number 26 Dirt
Is the for loop not working correctly? Or is it actually listed twice in the table? Both are impossible?
Here is the code I'm running:
Code: Select all
function map:getIndexMap()
local map = map:getMap()
for xIndex,xValue in pairs(map) do
for yIndex,yValue in pairs(xValue) do
print(type(xIndex), xIndex,
type(yIndex), yIndex,
yValue)
end
end
end
Code: Select all
number 30 number 0 Dirt
number 30 number 1 Dirt
number 30 number 2 Dirt
number 30 number 3 Dirt
number 30 number 4 Dirt
number 30 number 5 Dirt
number 30 number 6 Dirt
number 30 number 7 Dirt
number 30 number 8 Dirt
number 30 number 9 Dirt
number 30 number 10 Dirt
number 30 number 11 Dirt
number 30 number 12 Dirt
number 30 number 13 Dirt
number 30 number 14 Dirt
number 30 number 15 Dirt
number 30 number 16 Dirt
number 30 number 17 Dirt
number 30 number 18 Dirt
number 30 number 19 Dirt
number 30 number 20 Dirt
number 30 number 21 Dirt
number 30 number 22 Dirt
number 30 number 23 Dirt
number 30 number 24 Dirt
number 30 number 25 Dirt
number 30 number 26 Dirt
number 30 number 27 Dirt
number 30 number 28 Dirt
number 30 number 29 Dirt
number 30 number 30 Dirt
number 30 number 31 Dirt
number 30 number 32 Dirt
number 30 number 33 Dirt
number 30 number 34 Dirt
number 30 number 35 Dirt
number 30 number 36 Dirt
number 30 number 37 Dirt
number 30 number 38 Dirt
number 30 number 39 Dirt
number 30 number 40 Dirt
number 30 number 41 Dirt
number 30 number 42 DirtStone
number 30 number 43 DirtStone
number 30 number 44 DirtStone
number 30 number 45 DirtStone
number 30 number 46 Dirt
number 30 number 47 Dirt
number 30 number 48 Dirt
number 30 number 49 Dirt
number 30 number 50 Dirt
number 30 number 51 Stone
number 30 number 52 Stone
number 30 number 53 Stone
number 30 number 54 Stone
number 30 number 55 Stone
number 30 number 56 Stone
number 30 number 57 Stone
number 30 number 58 Stone
number 30 number 59 Stone
number 30 number 60 Stone
number 30 number 61 Stone
number 30 number 62 Stone
number 30 number 63 Stone
number 30 number 64 Stone
number 30 number 65 Stone
number 30 number 66 Stone
number 30 number 67 Stone
number 30 number 68 Stone
number 30 number 69 Stone
number 30 number 70 Stone
number 30 number 71 Stone
number 30 number 72 Stone
number 30 number 73 Stone
number 30 number 74 Stone
number 30 number 75 Stone
number 30 number -2 Dirt
number 30 number -11 Dirt
number 30 number 54 Dirt
number 30 number -9 Dirt
number 30 number 26 Dirt
number 30 number 30 Dirt
number 30 number -1 Dirt
number 30 number 53 Dirt
number 30 number 61 Dirt
number 30 number 52 Dirt
number 30 number 60 Dirt
number 30 number 27 Dirt
number 30 number 51 Dirt
number 30 number -14 Dirt
number 30 number -12 Dirt
number 30 number -10 Dirt
number 30 number 58 Dirt
number 30 number -8 Dirt
number 30 number 28 Dirt
number 30 number -7 Dirt
number 30 number 32 Dirt
number 30 number -6 Dirt
number 30 number 57 Dirt
number 30 number -5 Dirt
number 30 number -15 Dirt
number 30 number 63 Dirt
number 30 number -4 Dirt
number 30 number 56 Dirt
number 30 number 62 Dirt
number 30 number -13 Dirt
number 30 number 64 Dirt
number 30 number 31 Dirt
number 30 number -3 Dirt
number 30 number 29 Dirt
number 30 number -16 Grass
number 30 number 55 Dirt
number 30 number 59 Dirt
You can find the full output at:
pastebin.com/2D4Q57h1
It is quiet lengthy though.