I’ve read you can start an “array” at any index in Lua, but “ipairs” seems to only work if it starts at 0.
<code>> function printIpairs(a)
>> for i, v in ipairs(a) do
>> print(i .. '=' .. v)
>> end
>> end
> printIpairs({4,5,6})
1=4
2=5
3=6
> s = {}
> s[0] = 4
> s[1] = 5
> s[2] = 6
> printIpairs(s)
1=5
2=6
> t = {}
> t[4] = 4
> t[5] = 5
> t[6] = 6
> printIpairs(t)
>
</code>
<code>> function printIpairs(a)
>> for i, v in ipairs(a) do
>> print(i .. '=' .. v)
>> end
>> end
> printIpairs({4,5,6})
1=4
2=5
3=6
> s = {}
> s[0] = 4
> s[1] = 5
> s[2] = 6
> printIpairs(s)
1=5
2=6
> t = {}
> t[4] = 4
> t[5] = 5
> t[6] = 6
> printIpairs(t)
>
</code>
> function printIpairs(a)
>> for i, v in ipairs(a) do
>> print(i .. '=' .. v)
>> end
>> end
> printIpairs({4,5,6})
1=4
2=5
3=6
> s = {}
> s[0] = 4
> s[1] = 5
> s[2] = 6
> printIpairs(s)
1=5
2=6
> t = {}
> t[4] = 4
> t[5] = 5
> t[6] = 6
> printIpairs(t)
>
So my question is, do s and t use “3 words” to store the 3 values
internally as a sequence, or more(4/6), bc part/whole is stored as a “mapping” instead?
And if they do use only 3 words, how do you find the “starting index” of the “sequence part”, if ipairs won’t give it to me?