I have some doubts about a question that was asked before (Lights out game algorithm). I cannot ask there because it's saying you need to have 50 points to add comments that's why I am adding it as a new question.
Can any one give me the example of the algorithm that was explained here?
I don't want backtracking I want Gaussian elimination method to solve lights out.
For example I have 2*2 matrix and it's initial state is as below.
1 0
0 1
How to solve above lights out grid using Gaussian elimination?
Can any one explain what this line is doing in the above given link ?
std::swap_ranges(toggle.row_begin(pivotRow), toggle.row_end(pivotRow),
toggle.row_begin(nextFreeRow));
std::swap(puzzle[pivotRow], puzzle[nextFreeRow]);
I also don't understand the below line
puzzle[row] ^= puzzle[nextFreeRow];
And how to run this code. Is the Function: SolveLightsOut(const Matrix& puzzle);is the main function ?