Support Forums
Multidimensional arrays.. - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Java Programming (https://www.supportforums.net/forumdisplay.php?fid=22)
+---- Thread: Multidimensional arrays.. (/showthread.php?tid=4867)



Multidimensional arrays.. - F3nix - 02-17-2010

Just spent an hour going through some Java texts, and multidimensional arrays is when my head started to hurt.

Anyone know what these are actually used for? (the code examples are a little confusing to follow)


RE: Multidimensional arrays.. - Project Evolution - 02-22-2010

Multidimensional arrays can be used for things such as x and y coordinates in a game,
Code:
MyArray[x][y]
they are also handy for geometry,
Code:
MySquareArray[x][y]
or even cubes,
Code:
MyCubeArray[x][y][z]

Hopefully you catch my drift.


RE: Multidimensional arrays.. - Ⱳąŗɗ - 03-13-2010

Hmm instead of declaring 7 different arrays in one script I made, I could have just made 4. Interesting....


RE: Multidimensional arrays.. - Project Evolution - 03-14-2010

(03-13-2010, 10:40 PM)MadHatter Wrote: Hmm instead of declaring 7 different arrays in one script I made, I could have just made 4. Interesting....

Although its a common way, more dimensions to an array actually is slower than using one.
For example,
Code:
MySquareArray[x][y]
is slower than,
Code:
MySquareArray[x*y]



RE: Multidimensional arrays.. - Ⱳąŗɗ - 03-16-2010

(03-14-2010, 09:05 AM)Project Evolution Wrote: Although its a common way, more dimensions to an array actually is slower than using one.
For example,
Code:
MySquareArray[x][y]
is slower than,
Code:
MySquareArray[x*y]

I see. I'll keep that in mind.