112
edits
Changes
TriForce
,→Assignment 3
past = added;
int count = 0; //number of values which can fit in this square
int guess = at0; //last value found which can fit in this square
for (int idx = 0; idx < N; ++idx) {
//Ensures that every square in each section is working on a different number in the section
} else {
count++;
guess = num + 1;
rowCount[row][num] ++;
colCount[col][num] ++;
//Find values which can go in only one spot in the section
if (notSeen[idx] &&
( rowCount[row][idx] == 1 || boxCount[box][idx] || colCount[col][idx] == 1)) {
count = 1;
guess = idx + 1; }
}
}
//One value Must go here
if (count == 1) {
at = guess--+ 1;
rowHas[row][guess] = true;
colHas[col][guess] = true;