X-Git-Url: https://harishankar.org/repos/?p=getaclue.git;a=blobdiff_plain;f=crosswordpuzzlecreator.py;h=baeccc58b86ca5565e1ec678198be1fa0d440029;hp=4ffffb345a1d260711870eeb0506be4fe9893158;hb=HEAD;hpb=8178235fb21779eed3615e502f2c4fdebd42150e diff --git a/crosswordpuzzlecreator.py b/crosswordpuzzlecreator.py index 4ffffb3..baeccc5 100644 --- a/crosswordpuzzlecreator.py +++ b/crosswordpuzzlecreator.py @@ -148,7 +148,8 @@ class CrosswordPuzzleCreator: sys.stdout.write (self.BLUE + "Across word at position: " + aword + "\n" + self.ENDCOL) clue = raw_input (self.BRICKRED + "Clue for across word: " + self.ENDCOL) self.puzzle.data[arow][acol].clue_across = clue - sys.stdout.write (self.BLUE + "Set the clue: \n" + self.puzzle.data[arow][acol].clue_across) + sys.stdout.write (self.BLUE + "Set the clue: \n" + + self.puzzle.data[arow][acol].clue_across + "\n") except crosswordpuzzle.NoWordException: sys.stderr.write ("No across word found at that position\n") @@ -158,7 +159,8 @@ class CrosswordPuzzleCreator: sys.stdout.write (self.BLUE + "Down word at position: " + dword + "\n" + self.ENDCOL) clue = raw_input (self.BRICKRED + "Clue for down word: " + self.ENDCOL) self.puzzle.data[drow][dcol].clue_down = clue - sys.stdout.write (self.BLUE + "Set the clue: \n" + self.puzzle.data[drow][dcol].clue_down) + sys.stdout.write (self.BLUE + "Set the clue: \n" + + self.puzzle.data[drow][dcol].clue_down + "\n") except crosswordpuzzle.NoWordException: sys.stderr.write ("No down word found at that position\n") @@ -233,6 +235,8 @@ class CrosswordPuzzleCreator: sys.stderr.write ("Word intersects badly with another word!\n") except crosswordpuzzle.FrozenGridException: sys.stderr.write ("Word cannot be added to a frozen puzzle.\n") + except crosswordpuzzle.WordCharsException: + sys.stderr.write ("Non-word characters in word. Cannot add.\n") # Export to image/HTML def on_export_image (self, solution=True):