Every piece is defined by a two-dimensional boolean Array, […]
Each position has the value true, if this position is filled by the piece.
The array must always be only as high and wide as necessary to accommodate the piece.
Does this mean that if my I piece is in horizontal alignment I would have to store it in a 1x4 array while if it is in vertical alignment I have to store it in a 4x1 array? Or would I be allowed to store it in a 4x4 array because in horizontal alignment it has width 4 and in vertical alignment it has height 4?
P.S. there is no category for the new project yet.
Every piece is defined by a two-dimensional boolean Array, whereas the first dimension represent the rows and the second, the columns.
Doesn’t this mean that Piece I would be 4x1, not 1x4? because rows are first.
We can rotate all the pieces, and all pieces except for the O piece look different in their different rotations, so accordingly, the piece matrix needs to reflect that as well. If the I piece is lying down flat (horizontal) , it fits in a matrix with 1 row and 4 columns, so a 1x4 matrix. If it’s standing up (vertical) , it fits in a matrix with 4 rows and 1 column, so a 4x1 matrix.