Greetins everyone,
I'm trying to understand the logic in some operation with different byte operator.
I'm looking at:
http://www.exampledepot.com/egs/Programs/sudoku_solver_SudokuSolver.html
More specifically, this operation from the set function:
boolean canSet = cells[loc] == 0
&& (colsSet[c] & (1<<num)) == 0
&& (rowsSet[r] & (1<<num)) == 0
&& (subgridSet[blockLoc] & (1<<num)) == 0;
if (!canSet)
{
return false;
}
From this function: public boolean set(int loc, int num)
colSet and rowSet are filled with a lots of 0.
The question is what is colsSet[c] & (1<<num) used for?
Thanks again :)