I want to create an Array representation of an Element (shape) (such as in Tetris)
For simplicity let's assume this Element will always be a length of 4.
so in an Array there might be
[0][1][1][1]
[0][0][0][1]
[0][0][0][0]
[0][0][0][0]
How would I go about calculating all possible rotations of this array? I wanted to create something where I can "draw" these shapes, and determine if it was valid (thus needing to check against the predefined element in the array, and each possible rotation of it)
Edit
Thank you TheLethalCoder for linking How do you rotate a two dimensional array?
I need not only the rotation (though that is already some great help) but also each possible position within the array.
A bit more of what my planned approach was :
The background will consist of a larger Array (Also 2D)
When I click on the Background, This is set as the initial point. At this point all shapes will match the input. (as all points have one point)
As the user goes to the next Point (Left, right, Up Down from the orig. point), I want to recalculate which Shapes still match the input (thus any positioning and rotation)