fix false grids

This commit is contained in:
2020-10-06 08:50:02 +02:00
parent a0af1272cf
commit dc6146d498
4 changed files with 61 additions and 49 deletions

View File

@ -98,9 +98,7 @@
forEach($testBox->neighbourhood as $neighbour)
$neighbour->searchAllowedValues();
}
$solutions = array();
forEach($this->findSolutions(false, 2, 4) as $solution) $solutions[$solution] = true;
if (count($solutions) == 1) {
if (count(iterator_to_array($this->findSolutions(false, 2, 4), true)) == 1) {
$nbClues -= count($testBoxes);
forEach($testBoxes as $testBox) array_unset_value($testBox, $untestedBoxes);
} else {