Good day,
I am having issues understanding 2D Array, I am trying to make an 8,8 array and then populate with the numbers 64 to 1.
This is how it’s coming out at the moment.
63, 62, 61, 60, 59, 58, 57, 56,
55, 54, 53, 52, 51, 50, 49, 48,
47, 0, 46, 45, 44, 43, 42, 41,
40, 0, 0, 39, 38, 37, 36, 35,
34, 0, 0, 0, 33, 32, 31, 30,
29, 0, 0, 0, 0, 28, 27, 26,
25, 0, 0, 0, 0, 0, 24, 23,
22, 0, 0, 0, 0, 0, 0, 21,
local array2D = require(game.ReplicatedStorage.Modules.Array2D)
local newArray = array2D.new(8,8,0)
local count = 64 -- Populate array from 64 to 1
for x = 1, 8 do
newArray:Set(x, 1, count)
count = count - 1
for y = x, 8 do
newArray:Set(x,y,count)
count = count - 1
end
end