Compare commits
18 Commits
67cd3594a6
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| c477355fe9 | |||
| f52c970bef | |||
| cf0a5a465e | |||
| 310a1883d2 | |||
| 4b92464c94 | |||
| c09ed80a52 | |||
| b145ae566a | |||
| 21e8f4134f | |||
| 31a40a7e93 | |||
| ad3992ac30 | |||
| 5feaa65955 | |||
| ed5795a6cc | |||
| bdb1a094c3 | |||
| 85efaca248 | |||
| 39c564fb89 | |||
| ba07a531d0 | |||
| f510310549 | |||
| 5091e6a888 |
29
400.php
Normal file → Executable file
29
400.php
Normal file → Executable file
@ -6,17 +6,22 @@
|
|||||||
<title>Requête incorrecte</title>
|
<title>Requête incorrecte</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<nav class="navbar mb-4">
|
||||||
<h1>Requête incorrecte</h1>
|
<h1 class="display-4 text-center m-auto">Sudoku</h1>
|
||||||
</header>
|
</nav>
|
||||||
L'adresse URL doit être de la forme :<br/>
|
<main class="container my-4">
|
||||||
<?=$dirUrl?>/?<em>grille</em><br/>
|
<header>
|
||||||
<em>grille</em> étant une suite de 81 caractères représentant la grille de gauche à droite puis de haut en bas, soit :
|
<h1 class="mb-4">Requête incorrecte</h1>
|
||||||
<ul>
|
</header>
|
||||||
<li>un chiffre entre 1 et 9 pour les cases connues</li>
|
L'adresse URL doit être de la forme :<br/>
|
||||||
<li>un point pour les case vides</li>
|
<?=$dirUrl?>/?<em>grille</em><br/>
|
||||||
</ul>
|
<em>grille</em> étant une suite de 81 caractères représentant la grille de gauche à droite puis de haut en bas, soit :
|
||||||
Exemple :<br/>
|
<ul>
|
||||||
<a href='<?=$newGridUrl?>'><?=$newGridUrl?></a>
|
<li>un chiffre entre 1 et 9 pour les cases connues</li>
|
||||||
|
<li>un tiret (-) pour les case vides</li>
|
||||||
|
</ul>
|
||||||
|
Exemple :<br/>
|
||||||
|
<a href='<?=$newGridUrl?>'><?=$newGridUrl?></a>
|
||||||
|
</main>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
5
README.md
Normal file
5
README.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Sudoku
|
||||||
|
|
||||||
|
Web sudoku assistant
|
||||||
|
|
||||||
|

|
||||||
27
classes.php
Normal file → Executable file
27
classes.php
Normal file → Executable file
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
const UNKNOWN = ".";
|
const UNKNOWN = "-";
|
||||||
|
|
||||||
$validGrids = array();
|
$validGrids = array();
|
||||||
|
|
||||||
@ -27,15 +27,19 @@
|
|||||||
|
|
||||||
class Box {
|
class Box {
|
||||||
public $values = array('1', '2', '3', '4', '5', '6', '7', '8', '9');
|
public $values = array('1', '2', '3', '4', '5', '6', '7', '8', '9');
|
||||||
|
public $value = UNKNOWN;
|
||||||
|
public $rowId;
|
||||||
|
public $columnId;
|
||||||
|
public $regionId;
|
||||||
|
public $candidates;
|
||||||
|
public $candidateRemoved = array();
|
||||||
|
public $neighbourhood = array();
|
||||||
|
|
||||||
function __construct($rowId, $columnId, $regionId) {
|
function __construct($rowId, $columnId, $regionId) {
|
||||||
$this->value = UNKNOWN;
|
|
||||||
$this->rowId = $rowId;
|
$this->rowId = $rowId;
|
||||||
$this->columnId = $columnId;
|
$this->columnId = $columnId;
|
||||||
$this->regionId = $regionId;
|
$this->regionId = $regionId;
|
||||||
$this->candidates = $this->values;
|
$this->candidates = $this->values;
|
||||||
$this->candidateRemoved = array();
|
|
||||||
$this->neighbourhood = array();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function searchCandidates() {
|
function searchCandidates() {
|
||||||
@ -48,8 +52,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Grid {
|
class Grid {
|
||||||
function __construct() {
|
|
||||||
$this->boxes = array();
|
private $boxes = array();
|
||||||
|
private $rows;
|
||||||
|
private $columns;
|
||||||
|
private $regions;
|
||||||
|
|
||||||
|
function __construct($gridStr="") {
|
||||||
$this->rows = array_fill(0, 9, array());
|
$this->rows = array_fill(0, 9, array());
|
||||||
$this->columns = array_fill(0, 9, array());
|
$this->columns = array_fill(0, 9, array());
|
||||||
$this->regions = array_fill(0, 9, array());
|
$this->regions = array_fill(0, 9, array());
|
||||||
@ -74,6 +83,12 @@
|
|||||||
if ($box != $neighbour && !in_array($neighbour, $box->neighbourhood))
|
if ($box != $neighbour && !in_array($neighbour, $box->neighbourhood))
|
||||||
$box->neighbourhood[] = $neighbour;
|
$box->neighbourhood[] = $neighbour;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($gridStr) {
|
||||||
|
$this->import($gridStr);
|
||||||
|
} else {
|
||||||
|
$this->generate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function import($gridStr) {
|
function import($gridStr) {
|
||||||
|
|||||||
0
favicon.png
Normal file → Executable file
0
favicon.png
Normal file → Executable file
|
Before Width: | Height: | Size: 542 B After Width: | Height: | Size: 542 B |
26
head.php
Normal file → Executable file
26
head.php
Normal file → Executable file
@ -1,10 +1,18 @@
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Sudoku</title>
|
<title>Sudoku</title><meta property="og:title" content="Sudoku" />
|
||||||
|
<meta property="og:type" content="game" />
|
||||||
|
<meta name="description" property="og:description" content="Remplissez la grille de sorte que chaque ligne, colonne et région (carré de 3×3 cases) contienne tous les chiffres de 1 à 9." />
|
||||||
|
<link rel="canonical" href="<?=$_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"].dirname($_SERVER["DOCUMENT_URI"])?>" />
|
||||||
|
<meta property="og:url" content="<?=$_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"].$_SERVER["DOCUMENT_URI"]?>" />
|
||||||
|
<meta property="og:image" content="<?=$_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"].dirname($_SERVER["DOCUMENT_URI"])?>/thumbnail.php?size=200&grid=<?=$currentGrid?>" />
|
||||||
|
<meta property="og:image:width" content="200" />
|
||||||
|
<meta property="og:image:height" content="200" />
|
||||||
|
<meta name="Language" CONTENT="fr" /><meta property="og:locale" content="fr_FR" />
|
||||||
|
<meta property="og:site_name" content="<?=$_SERVER["HTTP_HOST"]?>" />
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-dark-5@1.1.3/dist/css/bootstrap-dark.min.css" rel="stylesheet" type="text/css" title="Automatique" />
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap-dark-5@1.1.3/dist/css/bootstrap-dark.min.css" rel="stylesheet">
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="alternate stylesheet" type="text/css" title="Clair" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous" />
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-dark-5@1.1.3/dist/css/bootstrap-night.min.css" rel="alternate stylesheet" type="text/css" title="Sombre" />
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.2.0/fonts/remixicon.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/remixicon@3.2.0/fonts/remixicon.css" rel="stylesheet">
|
||||||
<link href="style.css" rel="stylesheet" type="text/css" />
|
<link href="style.css" rel="stylesheet" type="text/css" />
|
||||||
|
|
||||||
@ -22,13 +30,3 @@
|
|||||||
<link href="thumbnail.php?grid=<?=$currentGrid?>&size=60" sizes="60x60" rel="apple-touch-icon">
|
<link href="thumbnail.php?grid=<?=$currentGrid?>&size=60" sizes="60x60" rel="apple-touch-icon">
|
||||||
<link href="thumbnail.php?grid=<?=$currentGrid?>&size=76" sizes="76x76" rel="apple-touch-icon">
|
<link href="thumbnail.php?grid=<?=$currentGrid?>&size=76" sizes="76x76" rel="apple-touch-icon">
|
||||||
<link href="manifest.php?grid=<?=$currentGrid?>" rel="manifest">
|
<link href="manifest.php?grid=<?=$currentGrid?>" rel="manifest">
|
||||||
|
|
||||||
<meta property="og:title" content="Sudoku" />
|
|
||||||
<meta property="og:type" content="website" />
|
|
||||||
<meta property="og:url" content="<?=$_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"].$_SERVER["DOCUMENT_URI"]?>" />
|
|
||||||
<meta property="og:image" content="<?=$_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"].dirname($_SERVER["DOCUMENT_URI"])?>/thumbnail.php?size=200&grid=<?=$currentGrid?>" />
|
|
||||||
<meta property="og:image:width" content="200" />
|
|
||||||
<meta property="og:image:height" content="200" />
|
|
||||||
<meta property="og:description" content="Remplissez la grille de sorte que chaque ligne, colonne et région (carré de 3×3 cases) contienne tous les chiffres de 1 à 9." />
|
|
||||||
<meta property="og:locale" content="fr_FR" />
|
|
||||||
<meta property="og:site_name" content="<?=$_SERVER["HTTP_HOST"]?>" />
|
|
||||||
|
|||||||
57
index.php
Normal file → Executable file
57
index.php
Normal file → Executable file
@ -1,40 +1,45 @@
|
|||||||
<?php
|
<?php
|
||||||
require("classes.php");
|
require("classes.php");
|
||||||
session_start();
|
|
||||||
$fullUrl = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"].$_SERVER["DOCUMENT_URI"];
|
$fullUrl = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"].$_SERVER["DOCUMENT_URI"];
|
||||||
$dirUrl = dirname($fullUrl);
|
$dirUrl = dirname($fullUrl);
|
||||||
$currentGrid = strip_tags($_SERVER['QUERY_STRING']);
|
$currentGrid = strip_tags($_SERVER['QUERY_STRING']);
|
||||||
|
|
||||||
if (preg_match("/^[1-9.]{81}$/", $currentGrid)) {
|
if (preg_match("/^[1-9-]{81}$/", $currentGrid)) {
|
||||||
if (!isset($_SESSION[$currentGrid]) || $_SESSION[$currentGrid] != "checked") {
|
session_id($currentGrid);
|
||||||
$grid = new Grid();
|
session_start(["use_cookies" => false]);
|
||||||
$grid->import($currentGrid);
|
|
||||||
if ($grid->containsDuplicates()) {
|
if (!array_key_exists("nbSolutions", $_SESSION)) {
|
||||||
|
$grid = new Grid($currentGrid);
|
||||||
|
$_SESSION["nbSolutions"] = $grid->containsDuplicates() ? -1 : $grid->countSolutions(2);
|
||||||
|
}
|
||||||
|
switch($_SESSION["nbSolutions"]) {
|
||||||
|
case -1:
|
||||||
$warning = "Cette grille contient des doublons.";
|
$warning = "Cette grille contient des doublons.";
|
||||||
} else {
|
break;
|
||||||
switch($grid->countSolutions(2)) {
|
case 0:
|
||||||
case 0:
|
$warning = "Cette grille n'a pas de solution.";
|
||||||
$warning = "Cette grille n'a pas de solution.";
|
break;
|
||||||
break;
|
case 1:
|
||||||
case 1:
|
break;
|
||||||
$validGrids[] = $currentGrid;
|
default:
|
||||||
break;
|
$warning = "Cette grille a plusieurs solutions.";
|
||||||
default:
|
|
||||||
$warning = "Cette grille a plusieurs solutions.";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
require("sudoku.php");
|
require("sudoku.php");
|
||||||
} else {
|
} else {
|
||||||
$grid = new Grid();
|
if ($currentGrid) {
|
||||||
$grid->generate();
|
|
||||||
$gridAsString = $grid->toString();
|
|
||||||
$newGridUrl = "$dirUrl/?$gridAsString";
|
|
||||||
$_SESSION[$gridAsString] = "checked";
|
|
||||||
if (!$currentGrid) {
|
|
||||||
header("Location: $newGridUrl");
|
|
||||||
} else {
|
|
||||||
require("400.php");
|
require("400.php");
|
||||||
|
} else {
|
||||||
|
$grid = new Grid();
|
||||||
|
$gridAsString = $grid->toString();
|
||||||
|
$newGridUrl = "$dirUrl/?$gridAsString";
|
||||||
|
|
||||||
|
session_id($gridAsString);
|
||||||
|
session_start(["use_cookies" => false]);
|
||||||
|
|
||||||
|
$_SESSION["nbSolutions"] = 1;
|
||||||
|
|
||||||
|
header("Location: $newGridUrl");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
0
manifest.php
Normal file → Executable file
0
manifest.php
Normal file → Executable file
0
service-worker.js
Normal file → Executable file
0
service-worker.js
Normal file → Executable file
7
style.css
Normal file → Executable file
7
style.css
Normal file → Executable file
@ -20,7 +20,7 @@ table input {
|
|||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
-moz-appearance: textfield !important;
|
appearance: textfield !important;
|
||||||
border-radius: 0 !important;
|
border-radius: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,6 +30,11 @@ table.table-success input,
|
|||||||
td.table-danger input:disabled,
|
td.table-danger input:disabled,
|
||||||
table input:not([disabled]) {
|
table input:not([disabled]) {
|
||||||
background: transparent !important;
|
background: transparent !important;
|
||||||
|
color: inherit !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
table input:not([disabled]):hover {
|
||||||
|
background: #9fb9b945 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
table input:disabled {
|
table input:disabled {
|
||||||
|
|||||||
16
sudoku.js
16
sudoku.js
@ -35,12 +35,12 @@ window.onload = function() {
|
|||||||
for (let box of row.getElementsByTagName('input')) {
|
for (let box of row.getElementsByTagName('input')) {
|
||||||
let regionId = rowId - rowId % 3 + Math.floor(columnId / 3)
|
let regionId = rowId - rowId % 3 + Math.floor(columnId / 3)
|
||||||
if (!box.disabled) {
|
if (!box.disabled) {
|
||||||
box.onfocus = onfocus
|
box.onfocus = onfocus
|
||||||
box.oninput = oninput
|
box.oninput = oninput
|
||||||
box.onblur = onblur
|
box.onblur = onblur
|
||||||
box.onclick = onclick
|
box.onclick = onclick
|
||||||
box.onmouseenter = onmouseenter
|
box.onmouseenter = onmouseenter
|
||||||
box.onmouseleave = onmouseleave
|
box.onmouseleave = onmouseleave
|
||||||
}
|
}
|
||||||
box.oncontextmenu = oncontextmenu
|
box.oncontextmenu = oncontextmenu
|
||||||
box.rowId = rowId
|
box.rowId = rowId
|
||||||
@ -82,10 +82,6 @@ window.onload = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
loadGame(history.state)
|
loadGame(history.state)
|
||||||
|
|
||||||
if ("serviceWorker" in navigator) {
|
|
||||||
navigator.serviceWorker.register(`service-worker.js`)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onpopstate = (event) => loadGame(event.state)
|
window.onpopstate = (event) => loadGame(event.state)
|
||||||
|
|||||||
65
sudoku.php
65
sudoku.php
@ -36,54 +36,44 @@
|
|||||||
<form id='sudokuForm' class='needs-validation' novalidate>
|
<form id='sudokuForm' class='needs-validation' novalidate>
|
||||||
<table id='grid' class='table mb-2'>
|
<table id='grid' class='table mb-2'>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php for ($row = 0; $row < 81; $row += 9): ?>
|
||||||
for ($row = 0; $row < 81; $row += 9) {
|
|
||||||
?>
|
|
||||||
<tr class="input-group d-inline-block w-auto">
|
<tr class="input-group d-inline-block w-auto">
|
||||||
<?php
|
<?php for ($column = 0; $column < 9; $column++): $value = $currentGrid[$row+$column]; ?>
|
||||||
for ($column = 0; $column < 9; $column++) {
|
<?php if ($value == UNKNOWN): ?>
|
||||||
$value = $currentGrid[$row+$column];
|
|
||||||
if ($value == UNKNOWN) {
|
|
||||||
?>
|
|
||||||
<td><input type='number' min='1' max='9' step='1' value='' class='form-control' /></td>
|
<td><input type='number' min='1' max='9' step='1' value='' class='form-control' /></td>
|
||||||
<?php
|
<?php else: ?>
|
||||||
} else {
|
|
||||||
?>
|
|
||||||
<td><input type='number' min='1' max='9' step='1' value='<?=$value?>' class='form-control' disabled /></td>
|
<td><input type='number' min='1' max='9' step='1' value='<?=$value?>' class='form-control' disabled /></td>
|
||||||
<?php
|
<?php endif ?>
|
||||||
}
|
<?php endfor?>
|
||||||
}
|
</tr>
|
||||||
?>
|
<?php endfor?>
|
||||||
</tr>
|
</tbody>
|
||||||
<?php
|
</table>
|
||||||
}
|
</form>
|
||||||
?>
|
<div class='d-flex mb-4'>
|
||||||
</tbody>
|
<div id='insertRadioGroup' class='radioGroup btn-group flex-fill'>
|
||||||
</table>
|
<input type='radio' class='btn-check' id='insertRadio0' value='' name='insertRadioGroup' onclick='insert(this)' accesskey='0' checked /><label for='insertRadio0' class='btn btn-primary' title='Clavier'><i class="ri-input-cursor-move"></i></label>
|
||||||
</form>
|
<?php for($value=1; $value<=9; $value++): ?>
|
||||||
<div class='d-flex mb-4'>
|
<input type='radio' class='btn-check' id='insertRadio<?=$value?>' value='<?=$value?>' name='insertRadioGroup' onclick='insert(this)' accesskey='<?=$value?>' disabled />
|
||||||
<div id='insertRadioGroup' class='radioGroup btn-group flex-fill'>
|
<label for='insertRadio<?=$value?>' class='btn btn-primary' title='Insérer un <?=$value?>'><?=$value?></label>
|
||||||
<input type='radio' class='btn-check' id='insertRadio0' value='' name='insertRadioGroup' onclick='insert(this)' accesskey='0' checked /><label for='insertRadio0' class='btn btn-primary' title='Clavier'><i class="ri-input-cursor-move"></i></label>
|
<?php endfor ?>
|
||||||
<?php
|
</div>
|
||||||
for($value=1; $value<=9; $value++) {
|
</div>
|
||||||
echo " <input type='radio' class='btn-check' id='insertRadio$value' value='$value' name='insertRadioGroup' onclick='insert(this)' accesskey='$value' disabled /><label for='insertRadio$value' class='btn btn-primary' title='Insérer un $value'>$value</label>\n";
|
<div class='mb-3'>
|
||||||
}
|
<?php if (isset($warning)): ?>
|
||||||
?>
|
<strong>⚠️ <?=$warning?> ⚠️</strong><br/>
|
||||||
|
<?php else: ?>
|
||||||
|
Remplissez la grille de sorte que chaque ligne, colonne et région (carré de 3×3 cases) contienne tous les chiffres de 1 à 9.
|
||||||
|
<?php endif?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='mb-3'><?php
|
|
||||||
if (isset($warning))
|
|
||||||
echo("<strong>⚠️ $warning ⚠️</strong><br/>");
|
|
||||||
else
|
|
||||||
echo("Remplissez la grille de sorte que chaque ligne, colonne et région (carré de 3×3 cases) contienne tous les chiffres de 1 à 9.")
|
|
||||||
?></div>
|
|
||||||
</main>
|
</main>
|
||||||
<aside class="col-md-3 text-center text-md-start">
|
<aside class="col-md-3 text-center text-md-start">
|
||||||
<div class="d-flex flex-column flex-shrink-0 p-3">
|
<div class="d-flex flex-column flex-shrink-0 p-3">
|
||||||
<ul class="nav nav-pills flex-column">
|
<ul class="nav nav-pills flex-column">
|
||||||
<li><a href="." class="nav-link link-body-emphasis">Nouvelle grille</a></li>
|
<li><a href="." class="nav-link link-body-emphasis">Nouvelle grille</a></li>
|
||||||
<li><a href="" class="nav-link link-body-emphasis">Lien vers cette grille</a></li>
|
<li><a href="" class="nav-link link-body-emphasis">Lien vers cette grille</a></li>
|
||||||
<li><a href="?................................................................................." class="nav-link link-body-emphasis">Grille vierge</a></li>
|
<li><a href="?---------------------------------------------------------------------------------" class="nav-link link-body-emphasis">Grille vierge</a></li>
|
||||||
<li><a id="fixGridLink" href="" class="nav-link link-body-emphasis">Figer la grille</a></li>
|
<li><a id="fixGridLink" href="" class="nav-link link-body-emphasis">Figer la grille</a></li>
|
||||||
<li><a href="https://git.malingrey.fr/adrien/Sudoku" class="nav-link link-body-emphasis">Code source</a></li>
|
<li><a href="https://git.malingrey.fr/adrien/Sudoku" class="nav-link link-body-emphasis">Code source</a></li>
|
||||||
<li><a href=".." class="nav-link link-body-emphasis">Autres jeux</a></li>
|
<li><a href=".." class="nav-link link-body-emphasis">Autres jeux</a></li>
|
||||||
@ -94,6 +84,7 @@
|
|||||||
<ul id='contextMenu' class='context-menu modal-content shadow list-group w-auto position-absolute'></ul>
|
<ul id='contextMenu' class='context-menu modal-content shadow list-group w-auto position-absolute'></ul>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
|
||||||
<script src='sudoku.js' defer></script>
|
<script src='sudoku.js' defer></script>
|
||||||
|
<script>navigator?.serviceWorker.register('service-worker.js')</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
4
thumbnail.php
Normal file → Executable file
4
thumbnail.php
Normal file → Executable file
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
require("classes.php");
|
require("classes.php");
|
||||||
if (isset($_GET["grid"]) && preg_match("/^[1-9.]{81}$/", $_GET["grid"]))
|
if (isset($_GET["grid"]) && preg_match("/^[1-9-]{81}$/", $_GET["grid"]))
|
||||||
$currentGrid = $_GET["grid"];
|
$currentGrid = $_GET["grid"];
|
||||||
else
|
else
|
||||||
$currentGrid = ".528.3....4.9.1...39.562......73.129...1.64.7...42.3656.13.5...28.6.4...4.5287...";
|
$currentGrid = "-528-3----4-9-1---39-562------73-129---1-64-7---42-3656-13-5---28-6-4---4-5287---";
|
||||||
header ("Content-type: image/png");
|
header ("Content-type: image/png");
|
||||||
if (isset($_GET['size']))
|
if (isset($_GET['size']))
|
||||||
$size = (int) $_GET['size'];
|
$size = (int) $_GET['size'];
|
||||||
|
|||||||
0
thumbnail.png
Normal file → Executable file
0
thumbnail.png
Normal file → Executable file
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Reference in New Issue
Block a user