This commit is contained in:
Adrien MALINGREY 2025-05-14 08:45:39 +02:00
parent 40be9eeee1
commit cb4078e4ce
2 changed files with 3 additions and 3 deletions

View File

@ -66,8 +66,8 @@ class Grille implements ArrayAccess
if (!isset($this->positions)) {
$this->positions = [];
for ($y = 0; $y < $hauteur; $y++) {
for ($x = 0; $x < $largeur; $x++)
for ($y = 0; $y < $this->hauteur; $y++) {
for ($x = 0; $x < $this->largeur; $x++)
$this->positions[] = [$x, $y];
}
$this->nb_positions = count($this->positions);

View File

@ -134,7 +134,7 @@ function formatter_definition($definition) {
<?php else: ?>
<td class="case blanche">
<input id="<?= chr($x + 65) . ($y + 1) ?>" type="text" maxlength="1" size="1" pattern="[A-Z]" placeholder="<?= $grille[$y][$x] ?>"
title="<?= strip_tags(" " . implode("\n→ ", array_map("formatter_definition", $grille->definitions["horizontales"][$y])) . "\n↓ " . implode("\n↓ ", array_map("formatter_definition", $grille->definitions["verticales"][$x]))) ?>" />
title="<?= strip_tags(" " . implode("\n→ ", array_map("formatter_definition", $grille->definitions["horizontales"][$y] ?? [])) . "\n↓ " . implode("\n↓ ", array_map("formatter_definition", $grille->definitions["verticales"][$x] ?? []))) ?>" />
</td>
<?php endif; ?>
<?php endfor; ?>