@@ 97-113 (lines=17) @@ | ||
94 | return $tempSolusion; |
|
95 | } |
|
96 | ||
97 | public function getEmptyLocation($data) |
|
98 | { |
|
99 | $location = []; |
|
100 | foreach ($data as $x => $cells) { |
|
101 | foreach ($cells as $y => $value) { |
|
102 | if (empty($value)) { |
|
103 | $position = (int)($x."".$y); |
|
104 | $location[$position] = [ |
|
105 | 'x' => $x, |
|
106 | 'y' => $y |
|
107 | ]; |
|
108 | } |
|
109 | } |
|
110 | } |
|
111 | ||
112 | return $location; |
|
113 | } |
|
114 | ||
115 | protected function getPossibilitiesValue($location, $data) |
|
116 | { |
@@ 31-47 (lines=17) @@ | ||
28 | return true; |
|
29 | } |
|
30 | ||
31 | public function getLocationHaveContents($data) |
|
32 | { |
|
33 | $location = []; |
|
34 | foreach ($data as $x => $cells) { |
|
35 | foreach ($cells as $y => $value) { |
|
36 | if (!empty($value)) { |
|
37 | $position = (int)($x."".$y); |
|
38 | $location[$position] = [ |
|
39 | 'x' => $x, |
|
40 | 'y' => $y |
|
41 | ]; |
|
42 | } |
|
43 | } |
|
44 | } |
|
45 | ||
46 | return $location; |
|
47 | } |
|
48 | ||
49 | protected function isValidVertical($location, $value, $data) |
|
50 | { |