def knowns(self): knowns = [] for element in self.elements: if element.hasValue(): value = element.getValue() if value in knowns: raise LogicError(value, knowns) knowns.append(value) knowns.sort() return Set(knowns)
def coords(self, knownValue): for element in self.elements: if element.hasValue(): if element.getValue()==knownValue: return element.row, element.col
def iterUnknownElements(self): for row in self._maxSize: for col in self._maxSize: element = self._findElement(row, col) if not element.hasValue(): yield element