style
This commit is contained in:
@ -101,7 +101,7 @@ class Grille implements Iterator, ArrayAccess {
|
||||
if ($x == $this->largeur - 1) {
|
||||
foreach (explode(" ", $this->get_ligne($y, $this->largeur)) as $rang => $mot) {
|
||||
if (strlen($mot) == 1) continue;
|
||||
if (in_array($mot, array_merge(...$this->lignes, ...$this->colonnes))) continue 2;
|
||||
if (in_array($mot, array_merge(...$this->lignes, ...$this->colonnes))) return;
|
||||
$this->lignes[$y][$rang] = $mot;
|
||||
}
|
||||
} else {
|
||||
@ -110,12 +110,7 @@ class Grille implements Iterator, ArrayAccess {
|
||||
if ($y == $this->hauteur - 1) {
|
||||
foreach (explode(" ", $this->get_colonne($x, $this->hauteur)) as $rang => $mot) {
|
||||
if (strlen($mot) == 1) continue;
|
||||
$nb_definitions = count($dico[strlen($mot)][$mot]);
|
||||
$occurences = 1;
|
||||
foreach (array_merge(...$this->lignes, ...$this->colonnes) as $mot2) {
|
||||
if ($mot != $mot2) continue;
|
||||
if (++$occurences >= $nb_definitions) continue 3;
|
||||
}
|
||||
if (in_array($mot, array_merge(...$this->lignes, ...$this->colonnes))) return;
|
||||
$this->colonnes[$x][$rang] = $mot;
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user