Implemented the reveal/hide solution functionality
[getaclue.git] / crosswordpuzzle.py
index 319a4fc..ffdd915 100644 (file)
@@ -636,5 +636,11 @@ class CrosswordPuzzle:
                                break
                        r += 1
 
+       # reveal/hide the entire solution by resetting revealed flag at all cells
+       def reveal_solution (self, revealed=True):
+               # run through the grid and set revealed to False
+               for row in range (self.rows):
+                       for col in range (self.cols):
+                               self.data[row][col].revealed = revealed