I’m a Defold beginner
So when I write this code and run it:
test = {}
for i = 10, 20, 0.5 do
print(i)
test[i] = i * 5
end
for key, val in pairs(test) do
print(key, val)
end
The result is:
|DEBUG:SCRIPT: 10|50|
|DEBUG:SCRIPT: 11|55|
|DEBUG:SCRIPT: 12|60|
|DEBUG:SCRIPT: 13|65|
|DEBUG:SCRIPT: 14|70|
|DEBUG:SCRIPT: 15|75|
|DEBUG:SCRIPT: 16|80|
|DEBUG:SCRIPT: 13.5|67.5|
|DEBUG:SCRIPT: 12.5|62.5|
|DEBUG:SCRIPT: 18.5|92.5|
|DEBUG:SCRIPT: 16.5|82.5|
|DEBUG:SCRIPT: 10.5|52.5|
|DEBUG:SCRIPT: 17.5|87.5|
|DEBUG:SCRIPT: 19.5|97.5|
|DEBUG:SCRIPT: 19|95|
|DEBUG:SCRIPT: 20|100|
|DEBUG:SCRIPT: 18|90|
|DEBUG:SCRIPT: 17|85|
|DEBUG:SCRIPT: 11.5|57.5|
|DEBUG:SCRIPT: 15.5|77.5|
|DEBUG:SCRIPT: 14.5|72.5|
Can anyone tell me why this order is so random?