Hi all and firstly thanks in advance :)
Now for some context, I'm making a game which requires the random generation of blocks to a point on the grid, I currently have all possible coordinates in a 2d array and processing randomly chooses a coordinate. Simple enough however the chosen coordinate is not removed from the array so it is possible blocks can appear on top of each other which doesn't work for the game. Having tried subset() to remove the chosen coordinate, I discovered I would need an arraylist. This is my 2d array:
I have a block function and using the following I can reference a coordinate:
int block1 = int(random(grid.length));
int j = 0;
int k = 1;
myBlock1 = new Block(color(colours[c1]), grid[block1][j], grid[block1][k]);
So I need to make this into a 2d arraylist so that I can remove the chosen coordinate from the array, any ideas on the syntax for the 2d arraylist and how i reference the coordinates?
Or if its possible to give me help on removing the used coordinates from the original array rather than using an arraylist?