First one is right but the 2nd one is wrong the very first X,Y coor are 0,0 and then 0,1 the array.at 0,3 is speed. I will tell you why .
arrays x/y is alway arranged like this
0,0 0,1 0,2 0,3
1,0 1,1 1,2 1,3
2,0 2,1 2,2 2,3
3,0 3,1 3,2 3,3
So you can see how theres a total of 16 slot but the max X is at 3 that because all array start at 0,0.
So by this example above has a 4x3 grid of space to a total value of 12 slot
Now go back and check what is each value and their coorindation array.at And do please tell me what is the current width and height and depth size of this array Width. Think of it like a rubric cube. Ill give you a head start this has a depth of 1 and Now tell me why does it has a depth of 1 as well as explain your answer how you got the width and the height of this array. If you need reference in how to figure out the width and height and depth go check up array in the manual page.
After you figure out this little homework ill show you some cool ways to not only reduce event but also a way to quickly find your value in a Callback function. As well as a build to with loops and push back.
Also did you know that since the dawn of math, array has always been here so this isn't new. But in the world of computer and networking we start array at 0,0 while in real world life it be 1,1