src/fsss.cpp
//#ifdef USE_LOCKED_CANDIDATES
//Based on bb_sudoku by Brian Turner.

ifdef USE_LOCKED_CANDIDATES
Based on bb_sudoku by Brian Turner.
ifdef USE_LOCKED_CANDIDATES Based on bb_sudoku by Brian Turner .
static void FindLockedCandidates (game &g)
{
	int i, j, k, b, ci;
	bitmap *gcp = g.cellPossibilities;
	bitmap tripletPossibilities[9];
restart:
	for (i = 0; i < 6; i++) {
		for(j = 0; j < 9; j++)
			tripletPossibilities[j] = gcp[tripletCells[i][j][0]] | gcp[tripletCells[i][j][1]] | gcp[tripletCells[i][j][2]];
		for (j = 0; j < 9; j++) {
			b = (
				((tripletPossibilities[affectedTriplets[j][0]] | tripletPossibilities[affectedTriplets[j][1]]) ^ 
				 (tripletPossibilities[affectedTriplets[j][2]] | tripletPossibilities[affectedTriplets[j][3]]))  
				& tripletPossibilities[j]);
			if (b == 0) continue;
			for (k = 0; k < 12; k++) { 
				ci = tripletAffectedCells[i][j][k];
				bitmap &cp = gcp[ci];
				if (cp & b) { 
					cp = (bitmap)(cp & ~b);
					if (cp == 0) { 
						g.mode |= MODE_STOP_PROCESSING;
						return;
					}
					if (Bitmap2Digit[cp]) { 
						setDigit(g, ci, cp);
						if(g.mode & MODE_STOP_PROCESSING) return;
						checkForLastOccurenceInGroup(g);
						if(g.mode & MODE_STOP_PROCESSING) return;
						goto restart;
					}
				}
			}
		} 
	} 
}
static void FindLockedCandidates ( game & g ) { int i , j , k , b , ci ; bitmap * gcp = g . cellPossibilities ; bitmap tripletPossibilities [ 9 ] ; restart : for ( i = 0 ; i < 6 ; i ++ ) { for ( j = 0 ; j < 9 ; j ++ ) tripletPossibilities [ j ] = gcp [ tripletCells [ i ] [ j ] [ 0 ] ] | gcp [ tripletCells [ i ] [ j ] [ 1 ] ] | gcp [ tripletCells [ i ] [ j ] [ 2 ] ] ; for ( j = 0 ; j < 9 ; j ++ ) { b = ( ( ( tripletPossibilities [ affectedTriplets [ j ] [ 0 ] ] | tripletPossibilities [ affectedTriplets [ j ] [ 1 ] ] ) ^ ( tripletPossibilities [ affectedTriplets [ j ] [ 2 ] ] | tripletPossibilities [ affectedTriplets [ j ] [ 3 ] ] ) ) & tripletPossibilities [ j ] ) ; if ( b == 0 ) continue ; for ( k = 0 ; k < 12 ; k ++ ) { ci = tripletAffectedCells [ i ] [ j ] [ k ] ; bitmap & cp = gcp [ ci ] ; if ( cp & b ) { cp = ( bitmap ) ( cp & ~ b ) ; if ( cp == 0 ) { g . mode |= MODE_STOP_PROCESSING ; return ; } if ( Bitmap2Digit [ cp ] ) { setDigit ( g , ci , cp ) ; if ( g . mode & MODE_STOP_PROCESSING ) return ; checkForLastOccurenceInGroup ( g ) ; if ( g . mode & MODE_STOP_PROCESSING ) return ; goto restart ; } } } } } }
ifdef USE_LOCKED_CANDIDATES
Based on bb_sudoku by Brian Turner.
ifdef USE_LOCKED_CANDIDATES Based on bb_sudoku by Brian Turner .
//int partialFound = 0; //some bits cleared but no digit found
 //found in the current triplet, and found in exactly one of the affected triplet pairs
 //row or column pair
 //square pair
 //don't care which bit where came from
 //6 from the row/col + 6 from the square
 //there is something to clear
 //no any possibility for this cell
 //single possibility remain?
 //for j
 //for i
