interface trie avec des strings
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
include_once "dico.php";
|
||||
include_once "Grille.php";
|
||||
|
||||
|
||||
@ -49,7 +48,7 @@ if ($grille_valide) {
|
||||
for ($y = 0; $y < $hauteur; $y++) {
|
||||
$definitions_horizontales[$y] = [];
|
||||
foreach ($grille->lignes[$y] as $mot) {
|
||||
$definitions = $grille->dico[strlen($mot)][str_split($mot)];
|
||||
$definitions = $grille->dico[strlen($mot)][$mot];
|
||||
if (count($definitions)) {
|
||||
$definitions_horizontales[$y][] = $definitions[mt_rand(0, count($definitions) - 1)];
|
||||
}
|
||||
@ -59,7 +58,7 @@ if ($grille_valide) {
|
||||
for ($x = 0 ; $x < $largeur; $x++) {
|
||||
$definitions_verticales[$x] = [];
|
||||
foreach ($grille->colonnes[$x] as $mot) {
|
||||
$definitions = $grille->dico[strlen($mot)][str_split($mot)];
|
||||
$definitions = $grille->dico[strlen($mot)][$mot];
|
||||
if (count($definitions)) {
|
||||
$definitions_verticales[$x][] = $definitions[mt_rand(0, count($definitions) - 1)];
|
||||
}
|
||||
|
Reference in New Issue
Block a user