diff --git a/400.php b/400.php
index a95f404..cc56d3e 100755
--- a/400.php
+++ b/400.php
@@ -18,7 +18,7 @@
grille étant une suite de 81 caractères représentant la grille de gauche à droite puis de haut en bas, soit :
- un chiffre entre 1 et 9 pour les cases connues
- - un point pour les case vides
+ - un tiret (-) pour les case vides
Exemple :
=$newGridUrl?>
diff --git a/classes.php b/classes.php
index 8372a13..349a4d1 100755
--- a/classes.php
+++ b/classes.php
@@ -1,5 +1,5 @@
value = UNKNOWN;
$this->rowId = $rowId;
$this->columnId = $columnId;
$this->regionId = $regionId;
$this->candidates = $this->values;
- $this->candidateRemoved = array();
- $this->neighbourhood = array();
}
function searchCandidates() {
@@ -48,8 +52,13 @@
}
class Grid {
+
+ private $boxes = array();
+ private $rows;
+ private $columns;
+ private $regions;
+
function __construct($gridStr="") {
- $this->boxes = array();
$this->rows = array_fill(0, 9, array());
$this->columns = array_fill(0, 9, array());
$this->regions = array_fill(0, 9, array());
diff --git a/index.php b/index.php
index c68f106..191459a 100755
--- a/index.php
+++ b/index.php
@@ -1,19 +1,19 @@
false]);
+
+ if (!array_key_exists("nbSolutions", $_SESSION)) {
$grid = new Grid($currentGrid);
- $sudokuGridSolutions[$currentGrid] = $grid->containsDuplicates() ? -1 : $grid->countSolutions(2);
+ $_SESSION["nbSolutions"] = $grid->containsDuplicates() ? -1 : $grid->countSolutions(2);
}
- switch($sudokuGridSolutions[$currentGrid]) {
+ switch($_SESSION["nbSolutions"]) {
case -1:
$warning = "Cette grille contient des doublons.";
break;
@@ -27,13 +27,18 @@
}
require("sudoku.php");
} else {
- $grid = new Grid();
- $gridAsString = $grid->toString();
- $newGridUrl = "$dirUrl/?$gridAsString";
- $sudokuGridSolutions[$gridAsString] = 1;
if ($currentGrid) {
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");
}
}