From 459c0e9ed2905e9cfc32027f442335ffe2d481a0 Mon Sep 17 00:00:00 2001 From: adrien Date: Fri, 5 Dec 2025 17:40:16 +0100 Subject: [PATCH] =?UTF-8?q?chaque=20d=C3=A9finition=20pointe=20vers=20le?= =?UTF-8?q?=20d=C3=A9but=20du=20mot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 52 +++++++++++++++++++++++++++++++--------------------- style.css | 4 ++++ 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/index.php b/index.php index 56d1a3c..5785e1a 100644 --- a/index.php +++ b/index.php @@ -64,6 +64,18 @@ function mot_courant($mots, $position) { } return []; } + +function debuts($definitions) { + $debut = 0; + $retour = []; + foreach ($definitions as $fin => $definition) { + if ($fin - $debut > 1) { + $retour[$debut] = $definition; + } + $debut = $fin + 1; + } + return $retour; +} ?> @@ -166,26 +178,25 @@ function mot_courant($mots, $position) {
    definitions["horizontales"] as $y => $definitions): - $definitions = array_filter( - $definitions, function($definition) { - return isset($definition[0]); - }); + $definitions = debuts($definitions); ?> - +
@@ -194,26 +205,25 @@ function mot_courant($mots, $position) {
    definitions["verticales"] as $x => $definitions): - $definitions = array_filter( - $definitions, function($definition) { - return isset($definition[0]); - }); + $definitions = debuts($definitions); ?> - +
diff --git a/style.css b/style.css index 530d51e..ba5f990 100644 --- a/style.css +++ b/style.css @@ -177,6 +177,10 @@ h2 { opacity: 30%; } +.definitions label { + cursor: pointer; +} + .erreur { text-align: center; }