auto import
This commit is contained in:
parent
31a40a7e93
commit
21e8f4134f
@ -48,7 +48,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Grid {
|
class Grid {
|
||||||
function __construct() {
|
function __construct($gridStr="") {
|
||||||
$this->boxes = array();
|
$this->boxes = array();
|
||||||
$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());
|
||||||
@ -74,6 +74,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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user