예제 #1
0
 def __iter__(self):
     for row, nrow in two_finger(self.rows):
         yield self.row(row)
         divider = self.divider(row, nrow)
         if "-" in divider:
             yield divider
     yield self.row(nrow)
예제 #2
0
 def irow(self, row):
     for square, nsquare in two_finger(row):
         yield self.square(square)
         yield " " if self.puzzle.in_same_region(square, nsquare) else "|"
     yield self.square(nsquare)
예제 #3
0
 def idivider(self, row, nrow):
     seperator = ["-" * self.vwidth, " " * self.vwidth]
     for (square, dsquare), (rsquare, csquare) in two_finger(zip(row, nrow)):
         yield seperator[self.puzzle.in_same_region(square, dsquare)]
         yield self.corner(square, rsquare, dsquare, csquare)
     yield seperator[self.puzzle.in_same_region(square, dsquare)]