diff --git a/dico.php b/dico.php index 0ce1368..0fa19e3 100644 --- a/dico.php +++ b/dico.php @@ -3,14 +3,12 @@ include_once "Trie.php"; const CASE_NOIRE = " "; -const MIN_PREMIER_MOT = 1; -const MIN_MOTS_SUIVANTS = 1; function dico($longueur_max) { $transliterator = Transliterator::createFromRules(':: Any-Latin; :: Latin-ASCII; :: NFD; :: [:Nonspacing Mark:] Remove; :: Upper(); :: NFC;', Transliterator::FORWARD); - $dico = [[""]]; + $dico = [[new Trie()]]; for ($longueur = 0; $longueur <= $longueur_max; $longueur++) { $dico[] = new Trie(); } @@ -48,7 +46,7 @@ function dico($longueur_max) { function mots_espaces($longueur_max) { $dico = dico($longueur_max); for ($longueur = 1; $longueur <= $longueur_max; $longueur++) { - for ($position_espace = MIN_PREMIER_MOT; $position_espace + MIN_MOTS_SUIVANTS < $longueur; $position_espace++) { + for ($position_espace = 1; $position_espace + 1 < $longueur; $position_espace++) { $mots_suivants = $dico[$longueur - $position_espace - 1]; foreach ($dico[$position_espace]->arrayIterator() as $premier_mot => $definition) { $premier_mot[] = CASE_NOIRE; diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..5d1ddd2 Binary files /dev/null and b/favicon.ico differ diff --git a/favicons/apple-touch-icon.png b/favicons/apple-touch-icon.png new file mode 100644 index 0000000..226c624 Binary files /dev/null and b/favicons/apple-touch-icon.png differ diff --git a/favicons/favicon-96x96.png b/favicons/favicon-96x96.png new file mode 100644 index 0000000..204973c Binary files /dev/null and b/favicons/favicon-96x96.png differ diff --git a/favicon.svg b/favicons/favicon.svg similarity index 100% rename from favicon.svg rename to favicons/favicon.svg diff --git a/favicons/web-app-manifest-192x192.png b/favicons/web-app-manifest-192x192.png new file mode 100644 index 0000000..b154094 Binary files /dev/null and b/favicons/web-app-manifest-192x192.png differ diff --git a/favicons/web-app-manifest-512x512.png b/favicons/web-app-manifest-512x512.png new file mode 100644 index 0000000..9d75253 Binary files /dev/null and b/favicons/web-app-manifest-512x512.png differ diff --git a/index.php b/index.php index 5f1b22f..d2b38fe 100644 --- a/index.php +++ b/index.php @@ -27,17 +27,42 @@ $largeur = filter_input(INPUT_GET, 'colonnes', FILTER_VALIDATE_INT, [ ]); $grille = new Grille($hauteur, $largeur); - +$basedir = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"].dirname($_SERVER["DOCUMENT_URI"]); if (!isset($_GET["grille"]) || $_GET["grille"] == "") { do { $id = uniqid(); } while (!$grille->genere($id)); $_GET["grille"] = $id; - header("Location: " . dirname($_SERVER['DOCUMENT_URI']) . "?" . http_build_query($_GET)); + header("Location: $basedir/?" . http_build_query($_GET)); exit; } +?> + + +
+ +