X-Git-Url: https://harishankar.org/repos/?p=getaclue.git;a=blobdiff_plain;f=crosswordpuzzle.py;fp=crosswordpuzzle.py;h=ffdd9157ba0608294b283d3927ea6dcbbad93760;hp=319a4fcfa3b33ededbefb9f05626b8482547c6d4;hb=d7084b7094c99003960b33d4bd4fb655248c6ab3;hpb=1f9de52c4798a22293aaf2c32611090a099d0ce4 diff --git a/crosswordpuzzle.py b/crosswordpuzzle.py index 319a4fc..ffdd915 100644 --- a/crosswordpuzzle.py +++ b/crosswordpuzzle.py @@ -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