rechangement de format du dictionnaire

This commit is contained in:
2025-12-03 17:26:36 +01:00
parent 974e2c203c
commit 563ba7ed0a
5 changed files with 4041 additions and 2852 deletions

View File

@@ -83,7 +83,11 @@ class Grille implements ArrayAccess
foreach($mots as $mot) {
$definitions = $this->dico[strlen($mot)][$mot];
if (count($definitions)) {
$this->definitions["horizontales"][$y][] = $definitions[mt_rand(0, count($definitions) - 1)];
$definition = $definitions[mt_rand(0, count($definitions) - 1)];
if (isset($definitions["nb_mots"])) {
$definition["nb_mots"] = $definitions["nb_mots"];
}
$this->definitions["horizontales"][$y][] = $definition;
}
}
}
@@ -92,7 +96,11 @@ class Grille implements ArrayAccess
foreach($mots as $mot) {
$definitions = $this->dico[strlen($mot)][$mot];
if (count($definitions)) {
$this->definitions["verticales"][$x][] = $definitions[mt_rand(0, count($definitions) - 1)];
$definition = $definitions[mt_rand(0, count($definitions) - 1)];
if (isset($definitions["nb_mots"])) {
$definition["nb_mots"] = $definitions["nb_mots"];
}
$this->definitions["verticales"][$x][] = $definition;
}
}
}