dimanche 10 février 2019

Lua: When defining keys in table, why is it inserted in a random order?

While working on a Love2d project, I noticed that when defining tables with a key and putting said tables in another table, in a loop, the tables were being inserted in a random order.

To test this, I made a short script that will hopefully explain my predicament a little better. My first assumption is because the keys are inserted wherever I have memory available, though I'm not sure. I've never encountered this before, anyone have any ideas?

Thank you,

enter image description here




Aucun commentaire:

Enregistrer un commentaire