java - 3d ArrayList vs arrayList of stack -
i'm trying recreate board game. board game has 4x4 dimension can represented 2d arraylist. however, i'm having difficulty doing deciding best method of implementing 4x4 board game each row , column can hold 4 items(in fashion of stack top item greatest int). 2d arraylist of stacks efficient in case, or 3d arraylist way go. similarly, how initialize 3d arraylist of integers? thanks!
efficiency going fine either way, whatever easiest kinds of things need squares. referencing things x,y coordinates? might want use 2-d array of tiles, can reference things
tile = board[x][y] this assumes origin @ top-left of board. it's efficient, if issue.
Comments
Post a Comment