auto import
This commit is contained in:
		| @ -48,7 +48,7 @@ | ||||
|     } | ||||
|      | ||||
|     class Grid { | ||||
|         function __construct() { | ||||
|         function __construct($gridStr="") { | ||||
|             $this->boxes = array(); | ||||
|             $this->rows = array_fill(0, 9, array()); | ||||
|             $this->columns = array_fill(0, 9, array()); | ||||
| @ -74,6 +74,12 @@ | ||||
|                     if ($box != $neighbour && !in_array($neighbour, $box->neighbourhood)) | ||||
|                         $box->neighbourhood[] = $neighbour; | ||||
|             } | ||||
|  | ||||
|             if ($gridStr) { | ||||
|                 $this->import($gridStr); | ||||
|             } else { | ||||
|                 $this->generate(); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         function import($gridStr) { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user