(self)
| 53 | silent = 0 # If true, count solutions only |
| 54 | |
| 55 | def display(self): |
| 56 | self.nfound = self.nfound + 1 |
| 57 | if self.silent: |
| 58 | return |
| 59 | print('+-' + '--'*self.n + '+') |
| 60 | for y in range(self.n-1, -1, -1): |
| 61 | print('|', end=' ') |
| 62 | for x in range(self.n): |
| 63 | if self.y[x] == y: |
| 64 | print("Q", end=' ') |
| 65 | else: |
| 66 | print(".", end=' ') |
| 67 | print('|') |
| 68 | print('+-' + '--'*self.n + '+') |
| 69 | |
| 70 | def main(): |
| 71 | import sys |