I have a simple grid puzzle: Example:
| X | Y | X |
| Y | X | Y |
| Y | X | Y |
The move is defined as a row or a column move. So when you move one cell, whole column/row moves. Example top row right 2 steps:
1 step
| X | X | Y |
| Y | X | Y |
| Y | X | Y |
2 step
| Y | X | X |
| Y | X | Y |
| Y | X | Y |
Now column move will look like this on the last row move up
1 step
| Y | X | Y |
| Y | X | Y |
| Y | X | X |
and so MoveRight - the most right cell will become the most left cell etc...
I am wondering if it is possible to go to every possible grid combination only with this moves. Let's assume that the grid will be 3x3 but it can be any size.
So, for example, I create random grid 3x3 with the same X count and Y count like this:
| Y | Y | Y |
| Y | Y | X |
| X | X | X |
Is it possible to check if there is a solution on how to make this grid the first grid with already specified moves? Or how to approach this problem?