From 4552a6f02d01ef07b97f436faddec6949f297720 Mon Sep 17 00:00:00 2001 From: adrien Date: Mon, 8 Dec 2025 11:03:38 +0100 Subject: [PATCH] peaufinage --- dico.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dico.php b/dico.php index 48ecf26..cb5b601 100644 --- a/dico.php +++ b/dico.php @@ -50,10 +50,12 @@ function dico($longueur_max) { return $dico; } -function mots_espaces($longueur_max, $longueur_min=1) { +function mots_espaces($longueur_max) { + $longueur_min = 1; $dico = dico($longueur_max); - for ($longueur = $longueur_max; $longueur >= $longueur_min + 1; $longueur--) { - for ($position_espace = $longueur - $longueur_min - 1; $position_espace >= $longueur_min; $position_espace--) { + for ($longueur = 3; $longueur <= $longueur_max; $longueur++) { + //$longueur_min = $longueur == $longueur_max ? 1 : 2; + for ($position_espace = $longueur - 2; $position_espace >= $longueur_min; $position_espace--) { $mots_suivants = $dico[$longueur - $position_espace - 1]; foreach ($dico[$position_espace] as $premier_mot => $definition) { $premier_mot[] = CASE_NOIRE;