Tries everywhere!

This commit is contained in:
2025-05-07 18:34:08 +02:00
parent b1f3e8b85f
commit ab9e1f08ef
5 changed files with 63 additions and 63 deletions

View File

@ -49,7 +49,7 @@ if ($grille_valide) {
for ($y = 0; $y < $hauteur; $y++) {
$definitions_horizontales[$y] = [];
foreach ($grille->lignes[$y] as $mot) {
$definitions = $dico[strlen($mot)][$mot];
$definitions = $dico[strlen($mot)][str_split($mot)];
if (count($definitions)) {
$definitions_horizontales[$y][] = $definitions[mt_rand(0, count($definitions) - 1)];
}
@ -59,7 +59,7 @@ if ($grille_valide) {
for ($x = 0 ; $x < $largeur; $x++) {
$definitions_verticales[$x] = [];
foreach ($grille->colonnes[$x] as $mot) {
$definitions = $dico[strlen($mot)][$mot];
$definitions = $dico[strlen($mot)][str_split($mot)];
if (count($definitions)) {
$definitions_verticales[$x][] = $definitions[mt_rand(0, count($definitions) - 1)];
}