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);
?>
- -
+
-
- = formatter_definition(reset($definitions)) ?>
+
+ = formatter_definition(reset($definitions)) ?>
+
-
-
- - = formatter_definition($definition) ?>
-
-
+ $definition) : ?>
+
+ - = formatter_definition($definition) ?>
+
+
-
+
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;
}