peaufinage
This commit is contained in:
8
dico.php
8
dico.php
@@ -50,10 +50,12 @@ function dico($longueur_max) {
|
|||||||
return $dico;
|
return $dico;
|
||||||
}
|
}
|
||||||
|
|
||||||
function mots_espaces($longueur_max, $longueur_min=1) {
|
function mots_espaces($longueur_max) {
|
||||||
|
$longueur_min = 1;
|
||||||
$dico = dico($longueur_max);
|
$dico = dico($longueur_max);
|
||||||
for ($longueur = $longueur_max; $longueur >= $longueur_min + 1; $longueur--) {
|
for ($longueur = 3; $longueur <= $longueur_max; $longueur++) {
|
||||||
for ($position_espace = $longueur - $longueur_min - 1; $position_espace >= $longueur_min; $position_espace--) {
|
//$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];
|
$mots_suivants = $dico[$longueur - $position_espace - 1];
|
||||||
foreach ($dico[$position_espace] as $premier_mot => $definition) {
|
foreach ($dico[$position_espace] as $premier_mot => $definition) {
|
||||||
$premier_mot[] = CASE_NOIRE;
|
$premier_mot[] = CASE_NOIRE;
|
||||||
|
|||||||
Reference in New Issue
Block a user