예제 #1
0
 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)
예제 #2
0
 def coords(self, knownValue):
     for element in self.elements:
         if element.hasValue():
             if element.getValue()==knownValue:
                 return element.row, element.col
예제 #3
0
 def iterUnknownElements(self):
     for row in self._maxSize:
         for col in self._maxSize:
             element = self._findElement(row, col)
             if not element.hasValue():
                 yield element