src/fsss.cpp
//Loop trough the groups, find the only cell containing particular digit in the group if any,
//then set the digit found.
//Since setting the digit changes the context, repeat until nothing found.
//On exit, the slower algorithms are expected to be run (i.e. guessing). 

Loop trough the groups, find the only cell containing particular digit in the group if any,
then set the digit found.
Since setting the digit changes the context, repeat until nothing found.
On exit, the slower algorithms are expected to be run .
Loop trough the groups find the only cell containing particular digit in the group if any then set the digit found . Since setting the digit changes the context repeat until nothing found . On exit the slower algorithms are expected to be run .
static void checkForLastOccurenceInGroup(game& g)
{
	int gi, duplicates, ci, cellPoss, groupPoss, uniques, newPoss;
	const bitmap *cp = g.cellPossibilities;
	const bitmap *gkd = g.groupKnownDigits;
	const cellIndex *gc;
restart:
	for (gi = 0; gi < 27; gi++) {
		groupPoss = 0;
		duplicates = 0;
		gc = cellsInGroup[gi];
		for (ci = 0; ci < 9; ci++) {
			cellPoss = cp[gc[ci]];
			duplicates |= (groupPoss & cellPoss); 
			groupPoss |= cellPoss;
		}
		if((groupPoss ^ gkd[gi]) != 511) { 
			g.mode |= MODE_STOP_PROCESSING;
			return;
		}
		uniques = groupPoss ^ duplicates;
		if(uniques == 0) continue;
		for (ci = 0; ci < 9; ci++) {
			newPoss = cp[gc[ci]] & uniques;
			if(newPoss == 0) continue;
			if (Bitmap2Digit[newPoss] == 0) { 
				g.mode |= MODE_STOP_PROCESSING;
				return;
				}
			setDigit(g, gc[ci], newPoss);
			if(g.mode & MODE_STOP_PROCESSING) return;
			uniques ^= newPoss; 
			if (uniques == 0) goto restart; 
		}
	} 
}
static void checkForLastOccurenceInGroup ( game & g ) { int gi , duplicates , ci , cellPoss , groupPoss , uniques , newPoss ; const bitmap * cp = g . cellPossibilities ; const bitmap * gkd = g . groupKnownDigits ; const cellIndex * gc ; restart : for ( gi = 0 ; gi < 27 ; gi ++ ) { groupPoss = 0 ; duplicates = 0 ; gc = cellsInGroup [ gi ] ; for ( ci = 0 ; ci < 9 ; ci ++ ) { cellPoss = cp [ gc [ ci ] ] ; duplicates |= ( groupPoss & cellPoss ) ; groupPoss |= cellPoss ; } if ( ( groupPoss ^ gkd [ gi ] ) != 511 ) { g . mode |= MODE_STOP_PROCESSING ; return ; } uniques = groupPoss ^ duplicates ; if ( uniques == 0 ) continue ; for ( ci = 0 ; ci < 9 ; ci ++ ) { newPoss = cp [ gc [ ci ] ] & uniques ; if ( newPoss == 0 ) continue ; if ( Bitmap2Digit [ newPoss ] == 0 ) { g . mode |= MODE_STOP_PROCESSING ; return ; } setDigit ( g , gc [ ci ] , newPoss ) ; if ( g . mode & MODE_STOP_PROCESSING ) return ; uniques ^= newPoss ; if ( uniques == 0 ) goto restart ; } } }
Loop trough the groups, find the only cell containing particular digit in the group if any,
then set the digit found.
Loop trough the groups find the only cell containing particular digit in the group if any then set the digit found .
//checks for group having some posible digit in only one cell
 //if(g->groupKnownDigits[gi] == 511) continue;
 //this tricky code is taken from bb_sudoku by Brian Turner
 //no place for some of the unknown digits
 //clear the unique possibilities from the group and process the unique cells
 //one of the cells of interest found
 //error: the same cell introduced > 1 unique digits in the group
 //the benefit from the following optimization is questionable
 //clear the already processed bit
 //no more bits
 //goto restart;
 //group loop
