+ # getting an across word at a number (note that the grid should be
+ # frozen for calling this otherwise a FrozenGridException will be raised)
+ def get_word_across_at_num (self, num):
+ # assert that the grid is frozen
+ self.assert_frozen_grid ()
+
+ # traverse the grid
+ for row in range (self.rows):
+ for col in range (self.cols):
+ if self.data[row][col].numbered == num:
+ word = self.get_word_across (row, col)
+ return word
+
+ # if number is not found
+ raise NoNumberException (num)
+
+ # getting a down word at a number (note that the grid should be frozen
+ # for calling this otherwise a FrozenGridException will be raised)
+ def get_word_down_at_num (self, num):
+ # assert that the grid is frozen
+ self.assert_frozen_grid ()
+
+ # traverse the grid
+ for row in range (self.rows):
+ for col in range (self.cols):
+ if self.data[row][col].numbered == num:
+ word = self.get_word_down (row, col)
+ return word
+
+ # if number is not found
+ raise NoNumberException (num)
+
+ # getting the position of a number on the grid (note that the grid should
+ # be frozen for calling this otherwise a FrozenGridException will be raised)
+ def get_position_of_num (self, num):
+ # assert that the grid is frozen
+ self.assert_frozen_grid ()
+
+ # traverse the grid
+ for row in range (self.rows):
+ for col in range (self.cols):
+ if self.data[row][col].numbered == num:
+ return (row, col)
+
+ # if number is not found
+ raise NoNumberException (num)
+