définitions
This commit is contained in:
74
index.php
74
index.php
@ -6,8 +6,8 @@ ini_set('error_reporting', E_ALL);
|
||||
include_once "dico.php";
|
||||
include_once "Grille.php";
|
||||
|
||||
const HAUTEUR_PAR_DEFAUT = 3;
|
||||
const LARGEUR_PAR_DEFAUT = 4;
|
||||
const HAUTEUR_PAR_DEFAUT = 5;
|
||||
const LARGEUR_PAR_DEFAUT = 5;
|
||||
|
||||
$hauteur = filter_input(INPUT_GET, 'lignes', FILTER_VALIDATE_INT, [
|
||||
"options" => [
|
||||
@ -33,43 +33,45 @@ $grille = new Grille($hauteur, $largeur);
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Mots croisés</title>
|
||||
<style>
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
th, td {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
td {
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
.case.noire {
|
||||
background-color: black;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="grille">
|
||||
<tr>
|
||||
<th></th>
|
||||
<?php for ($c = 0; $c < $largeur; $c++): ?>
|
||||
<th><?= chr($c + 65) ?></th>
|
||||
<div class="grille">
|
||||
<table class="grille">
|
||||
<tr>
|
||||
<th></th>
|
||||
<?php for ($c = 0; $c < $largeur; $c++): ?>
|
||||
<th><?= chr($c + 65) ?></th>
|
||||
<?php endfor; ?>
|
||||
</tr>
|
||||
<?php for ($l = 0; $l < $hauteur; $l++): ?>
|
||||
<tr>
|
||||
<th><?= $l ?></th>
|
||||
<?php for ($c = 0; $c < $largeur; $c++): ?>
|
||||
<td class="case <?= $grille->grille[$l][$c]==" "?"noire": "blanche" ?>"><?= $grille->grille[$l][$c] ?></td>
|
||||
<?php endfor; ?>
|
||||
</tr>
|
||||
<?php endfor; ?>
|
||||
</tr>
|
||||
<?php for ($l = 0; $l < $hauteur; $l++): ?>
|
||||
<tr>
|
||||
<th><?= $l ?></th>
|
||||
<?php for ($c = 0; $c < $largeur; $c++): ?>
|
||||
<td class="case <?= $grille->grille[$l][$c]==" "?"noire": "blanche" ?>"><?= $grille->grille[$l][$c] ?></td>
|
||||
<?php endfor; ?>
|
||||
</tr>
|
||||
<?php endfor; ?>
|
||||
</table>
|
||||
</table>
|
||||
</div>
|
||||
<div class="definitions">
|
||||
<div class="horizontales">
|
||||
<h2>Horizontalement</h2>
|
||||
<ol>
|
||||
<?php for ($l = 0; $l < $hauteur; $l++): ?>
|
||||
<li><?= $dico[$grille->get_ligne($l, $largeur)] ?></li>
|
||||
<?php endfor; ?>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="verticales">
|
||||
<h2>Verticalement</h2>
|
||||
<ol type="A">
|
||||
<?php for ($c = 0; $c < $largeur; $c++): ?>
|
||||
<li><?= $dico[$grille->get_colonne($c, $hauteur)] ?></li>
|
||||
<?php endfor; ?>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</html>
|
Reference in New Issue
Block a user