diff --git a/dico.php b/dico.php index 56ffff2..c27f391 100644 --- a/dico.php +++ b/dico.php @@ -45,8 +45,7 @@ function mots_espaces($longueur) { fisherYatesShuffle($mots_de_n_lettres[$longueur]); foreach($mots_de_n_lettres[$longueur] as $mot) { yield $mot; - $nb_mots++; - if ($nb_mots > MAX_MOTS) { + if (++$nb_mots > MAX_MOTS) { return; } } @@ -60,7 +59,7 @@ function mots_espaces($longueur) { yield "$mot2 $mot1"; $nb_mots += 2; if ($nb_mots > MAX_MOTS) { - break; + return; } } } diff --git a/index.php b/index.php index b07bd24..55b4c01 100644 --- a/index.php +++ b/index.php @@ -97,6 +97,7 @@ $grille = new Grille($hauteur, $largeur, $id); +