| 188 | self.map_data(self.data_cache, mask_pattern) |
| 189 | |
| 190 | def setup_position_probe_pattern(self, row, col): |
| 191 | for r in range(-1, 8): |
| 192 | if row + r <= -1 or self.modules_count <= row + r: |
| 193 | continue |
| 194 | |
| 195 | for c in range(-1, 8): |
| 196 | if col + c <= -1 or self.modules_count <= col + c: |
| 197 | continue |
| 198 | |
| 199 | if ( |
| 200 | (0 <= r <= 6 and c in {0, 6}) |
| 201 | or (0 <= c <= 6 and r in {0, 6}) |
| 202 | or (2 <= r <= 4 and 2 <= c <= 4) |
| 203 | ): |
| 204 | self.modules[row + r][col + c] = True |
| 205 | else: |
| 206 | self.modules[row + r][col + c] = False |
| 207 | |
| 208 | def best_fit(self, start=None): |
| 209 | """ |