Say I have a 2D int array.
int[][] board = new int[10][20]; public void initBoard() { for(int r = 0; r < 10; r++) for(int c = 0; c < 20; c++) board[r][c] = 0; }
0 means no. Pieces are represented by 1-7;
1 - Z Shape
2 - S Form
3 - line shape
4 - T Shape
5 - Box shape
6 - L Shape
7 - Back L Shape
What is the best way to fill the entire array with random forms and not leave spaces.
Note. I have a game, I'm just trying to adapt it to something else, still using the Tetris gameplay.
source share