Find the most efficient mask pattern.
(self)
| 236 | return self.version |
| 237 | |
| 238 | def best_mask_pattern(self): |
| 239 | """ |
| 240 | Find the most efficient mask pattern. |
| 241 | """ |
| 242 | min_lost_point = 0 |
| 243 | pattern = 0 |
| 244 | |
| 245 | for i in range(8): |
| 246 | self.makeImpl(True, i) |
| 247 | |
| 248 | lost_point = util.lost_point(self.modules) |
| 249 | |
| 250 | if i == 0 or min_lost_point > lost_point: |
| 251 | min_lost_point = lost_point |
| 252 | pattern = i |
| 253 | |
| 254 | return pattern |
| 255 | |
| 256 | def print_tty(self, out=None): |
| 257 | """ |