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; } +?> + + + + + πŸ„ΌπŸ„ΎπŸ…ƒπŸ…‚β–£πŸ„²πŸ…πŸ„ΎπŸ„ΈπŸ…‚πŸ„΄πŸ…‚ + + + + + + + + + + + + + + + + "/> + + +load($id) || $grille->genere($id); @@ -92,16 +117,6 @@ if ($grille_valide) { } } ?> - - - - - - πŸ„Όβ–‘β–‘πŸ…‚β– πŸ„²β–‘β–‘β–‘πŸ…‚β–‘πŸ„΄πŸ…‚ - - - -
@@ -210,7 +225,7 @@ if ($grille_valide) {
- + de value="" min="" max=""/> diff --git a/site.webmanifest b/site.webmanifest new file mode 100644 index 0000000..bd55cd9 --- /dev/null +++ b/site.webmanifest @@ -0,0 +1,21 @@ +{ + "name": "πŸ„ΌπŸ„ΎπŸ…ƒπŸ…‚ πŸ„²πŸ…πŸ„ΎπŸ„ΈπŸ…‚πŸ„΄πŸ…‚", + "short_name": "Mots croisΓ©s", + "icons": [ + { + "src": "favicons/web-app-manifest-192x192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "favicons/web-app-manifest-512x512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" + } \ No newline at end of file diff --git a/thumbnail.png b/thumbnail.png index 996aee2..058341a 100644 Binary files a/thumbnail.png and b/thumbnail.png differ