fork download
  1. #нужно найти все слова из списка words, которые есть в матрице board
  2. class Solution3:
  3. def find_index(self, search_matrix, symbol):
  4. """
  5. Функция поиска всех положений symbol в матрице search_matrix.
  6. Возвращает список кортежей с позициями symbol в виде [(i1, j1), ... (in, jn)]
  7. """
  8. result_list = []
  9. for i, v in enumerate(search_matrix):
  10. for j, v2 in enumerate(v):
  11. if v2 == symbol:
  12. result_list.append((i, j))
  13. return result_list
  14.  
  15. def next_index(self, positions_list, max_str_index, max_clmn_index):
  16. """
  17. Функция поиска соседей текущей позиции positions_list[-1].
  18. Position_list содержит последовательные координаты (i, j) букв искомого слова в матрице
  19. Соседи не должны выходить за границы матрицы max_str_index и max_clmn_index
  20. и не должны уже находиться в position_list
  21. Возвращает список кортежей с позициями соседей в виде [(i1, j1), ... ]
  22. """
  23. i, j = positions_list[-1]
  24. all_neighbours = [(i-1, j), (i, j+1), (i+1, j), (i, j-1)]
  25. return [x for x in all_neighbours if 0<=x[0]<=max_str_index and 0<=x[1]<=max_clmn_index and x not in positions_list]
  26.  
  27. def find_word(self, board, word, start_position, max_str_index, max_clmn_index):
  28. """
  29. Функция поиска слова word в матрице board
  30. Возвращает функцию check_matrix()
  31. """
  32. #создаём список в который будем добавлять координаты (i,j) последующей найденной буквы искомого слова
  33. lettersIndexesList = [start_position,]
  34. #устанавливаем флаг нахождения слова в матрице
  35. isWordInBoard = False
  36. #индекс следующей проверяемой буквы слова word
  37. nextLetterIndex=1
  38. def check_matrix(board, word, max_str_index, max_clmn_index):
  39. #даём доступ функции к переменным find_word, поскольку их состояние должно сохраняться
  40. nonlocal isWordInBoard
  41. nonlocal nextLetterIndex
  42. #находим соседей для последнего добавленного элемента в lettersIndexesList
  43. all_neighbours = self.next_index(lettersIndexesList, max_str_index, max_clmn_index)
  44. #устанавливаем счётчик проходения соседей
  45. num_neighbours = len(all_neighbours)
  46. #если соседей нет или всех соседей обошли и ничего больше не добавили в lettersIndexesList,
  47. #то удаляем последний элемент из lettersIndexesList, потому что он тупиковый и понижаем nextLetterIndex
  48. if num_neighbours == 0:
  49. del lettersIndexesList[-1]
  50. nextLetterIndex -= 1
  51. print('###############################')
  52. print('del lettersIndexesList')
  53. print(lettersIndexesList)
  54. print('###############################')
  55. #если в lettersIndexesList было несколько элементов и удалили только последний,
  56. #то пытаемся продолжать итерировать по соседям предыдущего элемента
  57. if not lettersIndexesList:
  58. check_matrix(board, word, max_str_index, max_clmn_index)
  59. #если в lettersIndexesList был только один элемент и он оказался удалён,
  60. #то возвращаем False, поскольку позиция первый буквы слова сразу оказалась тупиковой
  61. else:
  62. return isWordInBoard
  63.  
  64. ###Вот где-то здесь и находится косяк, во-первых, удаление элемента осуществяется вне цикла,
  65. ###так что после удаления непонятно как возратиться к итерированию по соседям предыдущего элемента
  66. ###Во-вторых, бывает такая ошибка, что в lettersIndexesList удаляется -1 элемент, но у -2 не осталось соседей,
  67. ###поэтому они ищутся у -3, при этом -2 остаётся в списке, в результате у нас может получиться последовательность координат
  68. ###которые находятся не рядом друг с другом
  69.  
  70. #если соседи у последнего элемента списка lettersIndexesList есть
  71. else:
  72. for neighbour_position in all_neighbours:
  73. print('^^^^^^^^^^^^^^^^^^^^^^^^^^^')
  74. print('main loop all_neighbours')
  75. print(all_neighbours)
  76. print('len all_neighbours')
  77. print(len(all_neighbours))
  78. print('num_neighbours')
  79. print(num_neighbours)
  80. #print('***********************************')
  81. print('lettersIndexesList')
  82. print(lettersIndexesList)
  83. #print('***********************************')
  84. print('^^^^^^^^^^^^^^^^^^^^^^^^^^^')
  85. #уменьшаем счётчик оставшихся для проверки соседей
  86. num_neighbours-=1
  87. #распаковываем текущий кортеж на отдельные элементы
  88. i, j = neighbour_position
  89. print('neighbour_position')
  90. print(neighbour_position)
  91. print('nextLetterIndex')
  92. print(nextLetterIndex)
  93. #сравниваем букву с координатами i,j с буквой слова word по индексу nextLetterIndex
  94. if board[i][j] == word[nextLetterIndex]:
  95. print('[i][j]')
  96. print((i, j))
  97. #если они равны, то добавляем координаты совпавшей буквы в lettersIndexesList
  98. lettersIndexesList.append(neighbour_position)
  99. #если достигли конца слова, то заканчиваем цикл и возвращаем True - слово word есть в матрице board
  100. if nextLetterIndex == len(word)-1:
  101. print('lettersIndexesList')
  102. print(lettersIndexesList)
  103. print('word')
  104. print(word)
  105. isWordInBoard = True
  106. break
  107. #в противном случае продолжаем поиск рекурсивно
  108. else:
  109. nextLetterIndex += 1
  110. check_matrix(board, word, max_str_index, max_clmn_index)
  111. #если не совпало, переходим к следующему элементу
  112. else:
  113. continue
  114. return isWordInBoard
  115. return check_matrix(board, word, max_str_index, max_clmn_index)
  116.  
  117. def findWords(self, board, words):
  118. """
  119. Функция для нахождения всех слов, входящих в матрицу board
  120. Возвращает список строк
  121. """
  122. #список для слов, входящих в матрицу board
  123. result_words = []
  124. #размерности матрицы board
  125. M = len(board)
  126. N = len(board[0])
  127. #общее количество элементов в матрице
  128. total_elements = M*N
  129. #итерируем по списку слов
  130. for word in words:
  131. #если количество букв в слове больше количества букв в матрице, то пропускаем слово и итерируем дальше
  132. if total_elements < len(word):
  133. continue
  134. else:
  135. #находим все вхождения первой буквы слова в виде списка кортежей с координатами
  136. start_positions = self.find_index(board, word[0])
  137. #итерируем по этому списку кортежей
  138. for start in start_positions:
  139. print('start_positions')
  140. print(start_positions)
  141. print('start')
  142. print(start)
  143. print('word')
  144. print(word)
  145. #если слово ещё не добавлено в result_words, если длина слова равно 1
  146. #или если find.words() возвращает True, добавляем слово в конечный список result_words
  147. if word not in result_words and \
  148. (len(word)==1 or self.find_word(board, word, start, M-1, N-1)):
  149. result_words.append(word)
  150. break
  151. else:
  152. continue
  153. return result_words
  154.  
  155.  
  156. board3 = [["d","c","e","b","d","e","d","a"],
  157. ["c","a","e","a","d","d","e","e"],
  158. ["a","c","e","d","b","c","c","b"],
  159. ["c","b","a","a","a","e","e","e"],
  160. ["a","e","d","e","b","d","d","e"],
  161. ["a","a","d","c","e","a","d","e"],
  162. ["b","d","e","b","b","b","c","e"],
  163. ["d","a","e","e","b","e","b","d"],
  164. ["b","b","c","a","b","b","b","a"],
  165. ["a","c","b","a","c","a","d","d"]]
  166. words3 = ["ab","bddbebcba","ededa","daebeda","edecaeabc","cbeedad","bcaaecb","c","eb","aadbdbacee","dcaaba"]
  167. #Expected output: ["c","eb","ededa","ab","daebeda"]
  168.  
  169. Solution3().findWords(board3, words3)
Runtime error #stdin #stdout 0.03s 9564KB
stdin
Standard input is empty
stdout
start_positions
[(0, 7), (1, 1), (1, 3), (2, 0), (3, 2), (3, 3), (3, 4), (4, 0), (5, 0), (5, 1), (5, 5), (7, 1), (8, 3), (8, 7), (9, 0), (9, 3), (9, 5)]
start
(0, 7)
word
ab
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 7), (0, 6)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(0, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 7)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 7), (0, 6)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(0, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 6)
nextLetterIndex
1
start_positions
[(0, 7), (1, 1), (1, 3), (2, 0), (3, 2), (3, 3), (3, 4), (4, 0), (5, 0), (5, 1), (5, 5), (7, 1), (8, 3), (8, 7), (9, 0), (9, 3), (9, 5)]
start
(1, 1)
word
ab
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 1), (1, 2), (2, 1), (1, 0)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(1, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 1)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 1), (1, 2), (2, 1), (1, 0)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(1, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 2)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 1), (1, 2), (2, 1), (1, 0)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(1, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 1)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 1), (1, 2), (2, 1), (1, 0)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(1, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 0)
nextLetterIndex
1
start_positions
[(0, 7), (1, 1), (1, 3), (2, 0), (3, 2), (3, 3), (3, 4), (4, 0), (5, 0), (5, 1), (5, 5), (7, 1), (8, 3), (8, 7), (9, 0), (9, 3), (9, 5)]
start
(1, 3)
word
ab
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 3), (1, 4), (2, 3), (1, 2)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(1, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 3)
nextLetterIndex
1
[i][j]
(0, 3)
lettersIndexesList
[(1, 3), (0, 3)]
word
ab
start_positions
[(0, 3), (2, 4), (2, 7), (3, 1), (4, 4), (6, 0), (6, 3), (6, 4), (6, 5), (7, 4), (7, 6), (8, 0), (8, 1), (8, 4), (8, 5), (8, 6), (9, 2)]
start
(0, 3)
word
bddbebcba
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 4), (1, 3), (0, 2)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(0, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 4)
nextLetterIndex
1
[i][j]
(0, 4)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 5), (1, 4)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(0, 3), (0, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 5)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 5), (1, 4)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(0, 3), (0, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 4)
nextLetterIndex
2
[i][j]
(1, 4)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 5), (2, 4), (1, 3)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(0, 3), (0, 4), (1, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 5)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 5), (2, 4), (1, 3)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(0, 3), (0, 4), (1, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 4)
nextLetterIndex
3
[i][j]
(2, 4)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 5), (3, 4), (2, 3)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(0, 3), (0, 4), (1, 4), (2, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 5)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 5), (3, 4), (2, 3)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(0, 3), (0, 4), (1, 4), (2, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 4)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 5), (3, 4), (2, 3)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(0, 3), (0, 4), (1, 4), (2, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 3)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 5), (2, 4), (1, 3)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(0, 3), (0, 4), (1, 4), (2, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 3)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 4), (1, 3), (0, 2)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(0, 3), (0, 4), (1, 4), (2, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 3)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 4), (1, 3), (0, 2)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(0, 3), (0, 4), (1, 4), (2, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 2)
nextLetterIndex
4
[i][j]
(0, 2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 2), (0, 1)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(0, 3), (0, 4), (1, 4), (2, 4), (0, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 2)
nextLetterIndex
5
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 2), (0, 1)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(0, 3), (0, 4), (1, 4), (2, 4), (0, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 1)
nextLetterIndex
5
start_positions
[(0, 3), (2, 4), (2, 7), (3, 1), (4, 4), (6, 0), (6, 3), (6, 4), (6, 5), (7, 4), (7, 6), (8, 0), (8, 1), (8, 4), (8, 5), (8, 6), (9, 2)]
start
(2, 4)
word
bddbebcba
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 4), (2, 5), (3, 4), (2, 3)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(2, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 4)
nextLetterIndex
1
[i][j]
(1, 4)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 4), (1, 5), (1, 3)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(2, 4), (1, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 4)
nextLetterIndex
2
[i][j]
(0, 4)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 5), (0, 3)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(2, 4), (1, 4), (0, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 5)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 5), (0, 3)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(2, 4), (1, 4), (0, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 3)
nextLetterIndex
3
[i][j]
(0, 3)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 3), (0, 2)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(2, 4), (1, 4), (0, 4), (0, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 3)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 3), (0, 2)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(2, 4), (1, 4), (0, 4), (0, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 2)
nextLetterIndex
4
[i][j]
(0, 2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 2), (0, 1)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(2, 4), (1, 4), (0, 4), (0, 3), (0, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 2)
nextLetterIndex
5
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 2), (0, 1)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(2, 4), (1, 4), (0, 4), (0, 3), (0, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 1)
nextLetterIndex
5
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 4), (1, 5), (1, 3)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(2, 4), (1, 4), (0, 4), (0, 3), (0, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 5)
nextLetterIndex
5
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 4), (1, 5), (1, 3)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(2, 4), (1, 4), (0, 4), (0, 3), (0, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 3)
nextLetterIndex
5
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 4), (2, 5), (3, 4), (2, 3)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(2, 4), (1, 4), (0, 4), (0, 3), (0, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 5)
nextLetterIndex
5
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 4), (2, 5), (3, 4), (2, 3)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(2, 4), (1, 4), (0, 4), (0, 3), (0, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 4)
nextLetterIndex
5
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 4), (2, 5), (3, 4), (2, 3)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(2, 4), (1, 4), (0, 4), (0, 3), (0, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 3)
nextLetterIndex
5
start_positions
[(0, 3), (2, 4), (2, 7), (3, 1), (4, 4), (6, 0), (6, 3), (6, 4), (6, 5), (7, 4), (7, 6), (8, 0), (8, 1), (8, 4), (8, 5), (8, 6), (9, 2)]
start
(2, 7)
word
bddbebcba
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 7), (3, 7), (2, 6)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(2, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 7)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 7), (3, 7), (2, 6)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(2, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 7)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 7), (3, 7), (2, 6)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(2, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 6)
nextLetterIndex
1
start_positions
[(0, 3), (2, 4), (2, 7), (3, 1), (4, 4), (6, 0), (6, 3), (6, 4), (6, 5), (7, 4), (7, 6), (8, 0), (8, 1), (8, 4), (8, 5), (8, 6), (9, 2)]
start
(3, 1)
word
bddbebcba
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 1), (3, 2), (4, 1), (3, 0)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(3, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 1)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 1), (3, 2), (4, 1), (3, 0)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(3, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 2)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 1), (3, 2), (4, 1), (3, 0)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(3, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(4, 1)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 1), (3, 2), (4, 1), (3, 0)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(3, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 0)
nextLetterIndex
1
start_positions
[(0, 3), (2, 4), (2, 7), (3, 1), (4, 4), (6, 0), (6, 3), (6, 4), (6, 5), (7, 4), (7, 6), (8, 0), (8, 1), (8, 4), (8, 5), (8, 6), (9, 2)]
start
(4, 4)
word
bddbebcba
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 4), (4, 5), (5, 4), (4, 3)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(4, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 4)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 4), (4, 5), (5, 4), (4, 3)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(4, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(4, 5)
nextLetterIndex
1
[i][j]
(4, 5)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 5), (4, 6), (5, 5)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(4, 4), (4, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 5)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 5), (4, 6), (5, 5)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(4, 4), (4, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(4, 6)
nextLetterIndex
2
[i][j]
(4, 6)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 6), (4, 7), (5, 6)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(4, 4), (4, 5), (4, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 6)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 6), (4, 7), (5, 6)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(4, 4), (4, 5), (4, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(4, 7)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 6), (4, 7), (5, 6)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(4, 4), (4, 5), (4, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 6)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 5), (4, 6), (5, 5)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(4, 4), (4, 5), (4, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 5)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 4), (4, 5), (5, 4), (4, 3)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(4, 4), (4, 5), (4, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 4)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 4), (4, 5), (5, 4), (4, 3)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(4, 4), (4, 5), (4, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(4, 3)
nextLetterIndex
3
start_positions
[(0, 3), (2, 4), (2, 7), (3, 1), (4, 4), (6, 0), (6, 3), (6, 4), (6, 5), (7, 4), (7, 6), (8, 0), (8, 1), (8, 4), (8, 5), (8, 6), (9, 2)]
start
(6, 0)
word
bddbebcba
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 0), (6, 1), (7, 0)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(6, 0)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 0)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 0), (6, 1), (7, 0)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(6, 0)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(6, 1)
nextLetterIndex
1
[i][j]
(6, 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 1), (6, 2), (7, 1)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(6, 0), (6, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 1)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 1), (6, 2), (7, 1)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(6, 0), (6, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(6, 2)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 1), (6, 2), (7, 1)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(6, 0), (6, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 1)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 0), (6, 1), (7, 0)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(6, 0), (6, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 0)
nextLetterIndex
2
[i][j]
(7, 0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 1), (8, 0)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(6, 0), (6, 1), (7, 0)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 1)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 1), (8, 0)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(6, 0), (6, 1), (7, 0)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(8, 0)
nextLetterIndex
3
[i][j]
(8, 0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(8, 1), (9, 0)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(6, 0), (6, 1), (7, 0), (8, 0)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(8, 1)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(8, 1), (9, 0)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(6, 0), (6, 1), (7, 0), (8, 0)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(9, 0)
nextLetterIndex
4
start_positions
[(0, 3), (2, 4), (2, 7), (3, 1), (4, 4), (6, 0), (6, 3), (6, 4), (6, 5), (7, 4), (7, 6), (8, 0), (8, 1), (8, 4), (8, 5), (8, 6), (9, 2)]
start
(6, 3)
word
bddbebcba
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 3), (6, 4), (7, 3), (6, 2)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(6, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 3)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 3), (6, 4), (7, 3), (6, 2)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(6, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(6, 4)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 3), (6, 4), (7, 3), (6, 2)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(6, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 3)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 3), (6, 4), (7, 3), (6, 2)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(6, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(6, 2)
nextLetterIndex
1
start_positions
[(0, 3), (2, 4), (2, 7), (3, 1), (4, 4), (6, 0), (6, 3), (6, 4), (6, 5), (7, 4), (7, 6), (8, 0), (8, 1), (8, 4), (8, 5), (8, 6), (9, 2)]
start
(6, 4)
word
bddbebcba
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 4), (6, 5), (7, 4), (6, 3)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(6, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 4)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 4), (6, 5), (7, 4), (6, 3)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(6, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(6, 5)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 4), (6, 5), (7, 4), (6, 3)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(6, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 4)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 4), (6, 5), (7, 4), (6, 3)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(6, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(6, 3)
nextLetterIndex
1
start_positions
[(0, 3), (2, 4), (2, 7), (3, 1), (4, 4), (6, 0), (6, 3), (6, 4), (6, 5), (7, 4), (7, 6), (8, 0), (8, 1), (8, 4), (8, 5), (8, 6), (9, 2)]
start
(6, 5)
word
bddbebcba
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 5), (6, 6), (7, 5), (6, 4)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(6, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 5)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 5), (6, 6), (7, 5), (6, 4)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(6, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(6, 6)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 5), (6, 6), (7, 5), (6, 4)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(6, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 5)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 5), (6, 6), (7, 5), (6, 4)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(6, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(6, 4)
nextLetterIndex
1
start_positions
[(0, 3), (2, 4), (2, 7), (3, 1), (4, 4), (6, 0), (6, 3), (6, 4), (6, 5), (7, 4), (7, 6), (8, 0), (8, 1), (8, 4), (8, 5), (8, 6), (9, 2)]
start
(7, 4)
word
bddbebcba
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(6, 4), (7, 5), (8, 4), (7, 3)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(7, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(6, 4)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(6, 4), (7, 5), (8, 4), (7, 3)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(7, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 5)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(6, 4), (7, 5), (8, 4), (7, 3)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(7, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(8, 4)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(6, 4), (7, 5), (8, 4), (7, 3)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(7, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 3)
nextLetterIndex
1
start_positions
[(0, 3), (2, 4), (2, 7), (3, 1), (4, 4), (6, 0), (6, 3), (6, 4), (6, 5), (7, 4), (7, 6), (8, 0), (8, 1), (8, 4), (8, 5), (8, 6), (9, 2)]
start
(7, 6)
word
bddbebcba
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(6, 6), (7, 7), (8, 6), (7, 5)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(7, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(6, 6)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(6, 6), (7, 7), (8, 6), (7, 5)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(7, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 7)
nextLetterIndex
1
[i][j]
(7, 7)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(6, 7), (8, 7)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(7, 6), (7, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(6, 7)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(6, 7), (8, 7)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(7, 6), (7, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(8, 7)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(6, 6), (7, 7), (8, 6), (7, 5)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(7, 6), (7, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(8, 6)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(6, 6), (7, 7), (8, 6), (7, 5)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(7, 6), (7, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 5)
nextLetterIndex
2
start_positions
[(0, 3), (2, 4), (2, 7), (3, 1), (4, 4), (6, 0), (6, 3), (6, 4), (6, 5), (7, 4), (7, 6), (8, 0), (8, 1), (8, 4), (8, 5), (8, 6), (9, 2)]
start
(8, 0)
word
bddbebcba
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 0), (8, 1), (9, 0)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(8, 0)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 0)
nextLetterIndex
1
[i][j]
(7, 0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(6, 0), (7, 1)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(8, 0), (7, 0)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(6, 0)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(6, 0), (7, 1)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(8, 0), (7, 0)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 1)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 0), (8, 1), (9, 0)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(8, 0), (7, 0)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(8, 1)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 0), (8, 1), (9, 0)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(8, 0), (7, 0)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(9, 0)
nextLetterIndex
2
start_positions
[(0, 3), (2, 4), (2, 7), (3, 1), (4, 4), (6, 0), (6, 3), (6, 4), (6, 5), (7, 4), (7, 6), (8, 0), (8, 1), (8, 4), (8, 5), (8, 6), (9, 2)]
start
(8, 1)
word
bddbebcba
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 1), (8, 2), (9, 1), (8, 0)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(8, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 1)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 1), (8, 2), (9, 1), (8, 0)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(8, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(8, 2)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 1), (8, 2), (9, 1), (8, 0)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(8, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(9, 1)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 1), (8, 2), (9, 1), (8, 0)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(8, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(8, 0)
nextLetterIndex
1
start_positions
[(0, 3), (2, 4), (2, 7), (3, 1), (4, 4), (6, 0), (6, 3), (6, 4), (6, 5), (7, 4), (7, 6), (8, 0), (8, 1), (8, 4), (8, 5), (8, 6), (9, 2)]
start
(8, 4)
word
bddbebcba
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 4), (8, 5), (9, 4), (8, 3)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(8, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 4)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 4), (8, 5), (9, 4), (8, 3)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(8, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(8, 5)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 4), (8, 5), (9, 4), (8, 3)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(8, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(9, 4)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 4), (8, 5), (9, 4), (8, 3)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(8, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(8, 3)
nextLetterIndex
1
start_positions
[(0, 3), (2, 4), (2, 7), (3, 1), (4, 4), (6, 0), (6, 3), (6, 4), (6, 5), (7, 4), (7, 6), (8, 0), (8, 1), (8, 4), (8, 5), (8, 6), (9, 2)]
start
(8, 5)
word
bddbebcba
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 5), (8, 6), (9, 5), (8, 4)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(8, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 5)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 5), (8, 6), (9, 5), (8, 4)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(8, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(8, 6)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 5), (8, 6), (9, 5), (8, 4)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(8, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(9, 5)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 5), (8, 6), (9, 5), (8, 4)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(8, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(8, 4)
nextLetterIndex
1
start_positions
[(0, 3), (2, 4), (2, 7), (3, 1), (4, 4), (6, 0), (6, 3), (6, 4), (6, 5), (7, 4), (7, 6), (8, 0), (8, 1), (8, 4), (8, 5), (8, 6), (9, 2)]
start
(8, 6)
word
bddbebcba
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 6), (8, 7), (9, 6), (8, 5)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(8, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 6)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 6), (8, 7), (9, 6), (8, 5)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(8, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(8, 7)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 6), (8, 7), (9, 6), (8, 5)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(8, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(9, 6)
nextLetterIndex
1
[i][j]
(9, 6)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(9, 7), (9, 5)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(8, 6), (9, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(9, 7)
nextLetterIndex
2
[i][j]
(9, 7)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(8, 7)]
len all_neighbours
1
num_neighbours
1
lettersIndexesList
[(8, 6), (9, 6), (9, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(8, 7)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(9, 7), (9, 5)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(8, 6), (9, 6), (9, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(9, 5)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 6), (8, 7), (9, 6), (8, 5)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(8, 6), (9, 6), (9, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(8, 5)
nextLetterIndex
3
[i][j]
(8, 5)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 5), (9, 5), (8, 4)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(8, 6), (9, 6), (9, 7), (8, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 5)
nextLetterIndex
4
[i][j]
(7, 5)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(6, 5), (7, 6), (7, 4)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(8, 6), (9, 6), (9, 7), (8, 5), (7, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(6, 5)
nextLetterIndex
5
[i][j]
(6, 5)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 5), (6, 6), (6, 4)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(8, 6), (9, 6), (9, 7), (8, 5), (7, 5), (6, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 5)
nextLetterIndex
6
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 5), (6, 6), (6, 4)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(8, 6), (9, 6), (9, 7), (8, 5), (7, 5), (6, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(6, 6)
nextLetterIndex
6
[i][j]
(6, 6)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 6), (6, 7), (7, 6)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(8, 6), (9, 6), (9, 7), (8, 5), (7, 5), (6, 5), (6, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 6)
nextLetterIndex
7
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 6), (6, 7), (7, 6)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(8, 6), (9, 6), (9, 7), (8, 5), (7, 5), (6, 5), (6, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(6, 7)
nextLetterIndex
7
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 6), (6, 7), (7, 6)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(8, 6), (9, 6), (9, 7), (8, 5), (7, 5), (6, 5), (6, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 6)
nextLetterIndex
7
[i][j]
(7, 6)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 7)]
len all_neighbours
1
num_neighbours
1
lettersIndexesList
[(8, 6), (9, 6), (9, 7), (8, 5), (7, 5), (6, 5), (6, 6), (7, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 7)
nextLetterIndex
8
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 5), (6, 6), (6, 4)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(8, 6), (9, 6), (9, 7), (8, 5), (7, 5), (6, 5), (6, 6), (7, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(6, 4)
nextLetterIndex
8
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(6, 5), (7, 6), (7, 4)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(8, 6), (9, 6), (9, 7), (8, 5), (7, 5), (6, 5), (6, 6), (7, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 6)
nextLetterIndex
8
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(6, 5), (7, 6), (7, 4)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(8, 6), (9, 6), (9, 7), (8, 5), (7, 5), (6, 5), (6, 6), (7, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(7, 4)
nextLetterIndex
8
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(7, 5), (9, 5), (8, 4)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(8, 6), (9, 6), (9, 7), (8, 5), (7, 5), (6, 5), (6, 6), (7, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(9, 5)
nextLetterIndex
8
[i][j]
(9, 5)
lettersIndexesList
[(8, 6), (9, 6), (9, 7), (8, 5), (7, 5), (6, 5), (6, 6), (7, 6), (9, 5)]
word
bddbebcba
start_positions
[(0, 2), (0, 5), (1, 2), (1, 6), (1, 7), (2, 2), (3, 5), (3, 6), (3, 7), (4, 1), (4, 3), (4, 7), (5, 4), (5, 7), (6, 2), (6, 7), (7, 2), (7, 3), (7, 5)]
start
(0, 2)
word
ededa
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 3), (1, 2), (0, 1)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(0, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 3)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 3), (1, 2), (0, 1)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(0, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 2)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 3), (1, 2), (0, 1)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(0, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 1)
nextLetterIndex
1
start_positions
[(0, 2), (0, 5), (1, 2), (1, 6), (1, 7), (2, 2), (3, 5), (3, 6), (3, 7), (4, 1), (4, 3), (4, 7), (5, 4), (5, 7), (6, 2), (6, 7), (7, 2), (7, 3), (7, 5)]
start
(0, 5)
word
ededa
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 6), (1, 5), (0, 4)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(0, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 6)
nextLetterIndex
1
[i][j]
(0, 6)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 7), (1, 6)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(0, 5), (0, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 7)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 7), (1, 6)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(0, 5), (0, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 6)
nextLetterIndex
2
[i][j]
(1, 6)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 7), (2, 6), (1, 5)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(0, 5), (0, 6), (1, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 7)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 7), (2, 6), (1, 5)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(0, 5), (0, 6), (1, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 6)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 7), (2, 6), (1, 5)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(0, 5), (0, 6), (1, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 5)
nextLetterIndex
3
[i][j]
(1, 5)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 5), (1, 4)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(0, 5), (0, 6), (1, 6), (1, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 5)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 5), (1, 4)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(0, 5), (0, 6), (1, 6), (1, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 4)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 6), (1, 5), (0, 4)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(0, 5), (0, 6), (1, 6), (1, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 5)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 6), (1, 5), (0, 4)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(0, 5), (0, 6), (1, 6), (1, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 4)
nextLetterIndex
4
start_positions
[(0, 2), (0, 5), (1, 2), (1, 6), (1, 7), (2, 2), (3, 5), (3, 6), (3, 7), (4, 1), (4, 3), (4, 7), (5, 4), (5, 7), (6, 2), (6, 7), (7, 2), (7, 3), (7, 5)]
start
(1, 2)
word
ededa
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 2), (1, 3), (2, 2), (1, 1)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(1, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 2)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 2), (1, 3), (2, 2), (1, 1)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(1, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 3)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 2), (1, 3), (2, 2), (1, 1)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(1, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 2)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 2), (1, 3), (2, 2), (1, 1)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(1, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 1)
nextLetterIndex
1
start_positions
[(0, 2), (0, 5), (1, 2), (1, 6), (1, 7), (2, 2), (3, 5), (3, 6), (3, 7), (4, 1), (4, 3), (4, 7), (5, 4), (5, 7), (6, 2), (6, 7), (7, 2), (7, 3), (7, 5)]
start
(1, 6)
word
ededa
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 6), (1, 7), (2, 6), (1, 5)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(1, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 6)
nextLetterIndex
1
[i][j]
(0, 6)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 7), (0, 5)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(1, 6), (0, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 7)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 7), (0, 5)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(1, 6), (0, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 5)
nextLetterIndex
2
[i][j]
(0, 5)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 5), (0, 4)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(1, 6), (0, 6), (0, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 5)
nextLetterIndex
3
[i][j]
(1, 5)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 5), (1, 4)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(1, 6), (0, 6), (0, 5), (1, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 5)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 5), (1, 4)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(1, 6), (0, 6), (0, 5), (1, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 4)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 5), (0, 4)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(1, 6), (0, 6), (0, 5), (1, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 4)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 6), (1, 7), (2, 6), (1, 5)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(1, 6), (0, 6), (0, 5), (1, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 7)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 6), (1, 7), (2, 6), (1, 5)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(1, 6), (0, 6), (0, 5), (1, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 6)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 6), (1, 7), (2, 6), (1, 5)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(1, 6), (0, 6), (0, 5), (1, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 5)
nextLetterIndex
4
start_positions
[(0, 2), (0, 5), (1, 2), (1, 6), (1, 7), (2, 2), (3, 5), (3, 6), (3, 7), (4, 1), (4, 3), (4, 7), (5, 4), (5, 7), (6, 2), (6, 7), (7, 2), (7, 3), (7, 5)]
start
(1, 7)
word
ededa
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 7), (2, 7), (1, 6)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(1, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 7)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 7), (2, 7), (1, 6)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(1, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 7)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 7), (2, 7), (1, 6)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(1, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 6)
nextLetterIndex
1
start_positions
[(0, 2), (0, 5), (1, 2), (1, 6), (1, 7), (2, 2), (3, 5), (3, 6), (3, 7), (4, 1), (4, 3), (4, 7), (5, 4), (5, 7), (6, 2), (6, 7), (7, 2), (7, 3), (7, 5)]
start
(2, 2)
word
ededa
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 2), (2, 3), (3, 2), (2, 1)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(2, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 2)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 2), (2, 3), (3, 2), (2, 1)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(2, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 3)
nextLetterIndex
1
[i][j]
(2, 3)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 3), (2, 4), (3, 3)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(2, 2), (2, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 3)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 3), (2, 4), (3, 3)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(2, 2), (2, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 4)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 3), (2, 4), (3, 3)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(2, 2), (2, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 3)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 2), (2, 3), (3, 2), (2, 1)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(2, 2), (2, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 2)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 2), (2, 3), (3, 2), (2, 1)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(2, 2), (2, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 1)
nextLetterIndex
2
start_positions
[(0, 2), (0, 5), (1, 2), (1, 6), (1, 7), (2, 2), (3, 5), (3, 6), (3, 7), (4, 1), (4, 3), (4, 7), (5, 4), (5, 7), (6, 2), (6, 7), (7, 2), (7, 3), (7, 5)]
start
(3, 5)
word
ededa
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 5), (3, 6), (4, 5), (3, 4)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(3, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 5)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 5), (3, 6), (4, 5), (3, 4)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(3, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 6)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 5), (3, 6), (4, 5), (3, 4)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(3, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(4, 5)
nextLetterIndex
1
[i][j]
(4, 5)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(4, 6), (5, 5), (4, 4)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(3, 5), (4, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(4, 6)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(4, 6), (5, 5), (4, 4)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(3, 5), (4, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 5)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(4, 6), (5, 5), (4, 4)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(3, 5), (4, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(4, 4)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 5), (3, 6), (4, 5), (3, 4)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(3, 5), (4, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 4)
nextLetterIndex
2
start_positions
[(0, 2), (0, 5), (1, 2), (1, 6), (1, 7), (2, 2), (3, 5), (3, 6), (3, 7), (4, 1), (4, 3), (4, 7), (5, 4), (5, 7), (6, 2), (6, 7), (7, 2), (7, 3), (7, 5)]
start
(3, 6)
word
ededa
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 6), (3, 7), (4, 6), (3, 5)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(3, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 6)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 6), (3, 7), (4, 6), (3, 5)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(3, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 7)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 6), (3, 7), (4, 6), (3, 5)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(3, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(4, 6)
nextLetterIndex
1
[i][j]
(4, 6)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(4, 7), (5, 6), (4, 5)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(3, 6), (4, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(4, 7)
nextLetterIndex
2
[i][j]
(4, 7)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 7), (5, 7)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(3, 6), (4, 6), (4, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 7)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 7), (5, 7)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(3, 6), (4, 6), (4, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 7)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(4, 7), (5, 6), (4, 5)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(3, 6), (4, 6), (4, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 6)
nextLetterIndex
3
[i][j]
(5, 6)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 7), (6, 6), (5, 5)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(3, 6), (4, 6), (4, 7), (5, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 7)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 7), (6, 6), (5, 5)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(3, 6), (4, 6), (4, 7), (5, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(6, 6)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 7), (6, 6), (5, 5)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(3, 6), (4, 6), (4, 7), (5, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 5)
nextLetterIndex
4
[i][j]
(5, 5)
lettersIndexesList
[(3, 6), (4, 6), (4, 7), (5, 6), (5, 5)]
word
ededa
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(4, 7), (5, 6), (4, 5)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(3, 6), (4, 6), (4, 7), (5, 6), (5, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(4, 5)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 6), (3, 7), (4, 6), (3, 5)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(3, 6), (4, 6), (4, 7), (5, 6), (5, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 5)
nextLetterIndex
4
start_positions
[(0, 0), (0, 4), (0, 6), (1, 4), (1, 5), (2, 3), (4, 2), (4, 5), (4, 6), (5, 2), (5, 6), (6, 1), (7, 0), (7, 7), (9, 6), (9, 7)]
start
(0, 0)
word
daebeda
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 1), (1, 0)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(0, 0)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 1)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 1), (1, 0)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(0, 0)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 0)
nextLetterIndex
1
start_positions
[(0, 0), (0, 4), (0, 6), (1, 4), (1, 5), (2, 3), (4, 2), (4, 5), (4, 6), (5, 2), (5, 6), (6, 1), (7, 0), (7, 7), (9, 6), (9, 7)]
start
(0, 4)
word
daebeda
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 5), (1, 4), (0, 3)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(0, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 5)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 5), (1, 4), (0, 3)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(0, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 4)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 5), (1, 4), (0, 3)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(0, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 3)
nextLetterIndex
1
start_positions
[(0, 0), (0, 4), (0, 6), (1, 4), (1, 5), (2, 3), (4, 2), (4, 5), (4, 6), (5, 2), (5, 6), (6, 1), (7, 0), (7, 7), (9, 6), (9, 7)]
start
(0, 6)
word
daebeda
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 7), (1, 6), (0, 5)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(0, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 7)
nextLetterIndex
1
[i][j]
(0, 7)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 7)]
len all_neighbours
1
num_neighbours
1
lettersIndexesList
[(0, 6), (0, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 7)
nextLetterIndex
2
[i][j]
(1, 7)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 7), (1, 6)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(0, 6), (0, 7), (1, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 7)
nextLetterIndex
3
[i][j]
(2, 7)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 7), (2, 6)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(0, 6), (0, 7), (1, 7), (2, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 7)
nextLetterIndex
4
[i][j]
(3, 7)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(4, 7), (3, 6)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(0, 6), (0, 7), (1, 7), (2, 7), (3, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(4, 7)
nextLetterIndex
5
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(4, 7), (3, 6)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(0, 6), (0, 7), (1, 7), (2, 7), (3, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 6)
nextLetterIndex
5
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 7), (2, 6)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(0, 6), (0, 7), (1, 7), (2, 7), (3, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 6)
nextLetterIndex
5
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 7), (1, 6)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(0, 6), (0, 7), (1, 7), (2, 7), (3, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 6)
nextLetterIndex
5
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 7), (1, 6), (0, 5)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(0, 6), (0, 7), (1, 7), (2, 7), (3, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 6)
nextLetterIndex
5
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 7), (1, 6), (0, 5)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(0, 6), (0, 7), (1, 7), (2, 7), (3, 7)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 5)
nextLetterIndex
5
start_positions
[(0, 0), (0, 4), (0, 6), (1, 4), (1, 5), (2, 3), (4, 2), (4, 5), (4, 6), (5, 2), (5, 6), (6, 1), (7, 0), (7, 7), (9, 6), (9, 7)]
start
(1, 4)
word
daebeda
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 4), (1, 5), (2, 4), (1, 3)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(1, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 4)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 4), (1, 5), (2, 4), (1, 3)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(1, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 5)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 4), (1, 5), (2, 4), (1, 3)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(1, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 4)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 4), (1, 5), (2, 4), (1, 3)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(1, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 3)
nextLetterIndex
1
[i][j]
(1, 3)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 3), (2, 3), (1, 2)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(1, 4), (1, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 3)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 3), (2, 3), (1, 2)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(1, 4), (1, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 3)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 3), (2, 3), (1, 2)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(1, 4), (1, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 2)
nextLetterIndex
2
[i][j]
(1, 2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 2), (2, 2), (1, 1)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(1, 4), (1, 3), (1, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 2)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 2), (2, 2), (1, 1)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(1, 4), (1, 3), (1, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 2)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 2), (2, 2), (1, 1)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(1, 4), (1, 3), (1, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 1)
nextLetterIndex
3
start_positions
[(0, 0), (0, 4), (0, 6), (1, 4), (1, 5), (2, 3), (4, 2), (4, 5), (4, 6), (5, 2), (5, 6), (6, 1), (7, 0), (7, 7), (9, 6), (9, 7)]
start
(1, 5)
word
daebeda
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 5), (1, 6), (2, 5), (1, 4)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(1, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 5)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 5), (1, 6), (2, 5), (1, 4)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(1, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 6)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 5), (1, 6), (2, 5), (1, 4)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(1, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 5)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 5), (1, 6), (2, 5), (1, 4)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(1, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 4)
nextLetterIndex
1
start_positions
[(0, 0), (0, 4), (0, 6), (1, 4), (1, 5), (2, 3), (4, 2), (4, 5), (4, 6), (5, 2), (5, 6), (6, 1), (7, 0), (7, 7), (9, 6), (9, 7)]
start
(2, 3)
word
daebeda
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 3), (2, 4), (3, 3), (2, 2)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(2, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 3)
nextLetterIndex
1
[i][j]
(1, 3)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 3), (1, 4), (1, 2)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(2, 3), (1, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 3)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 3), (1, 4), (1, 2)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(2, 3), (1, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 4)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 3), (1, 4), (1, 2)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(2, 3), (1, 3)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 2)
nextLetterIndex
2
[i][j]
(1, 2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 2), (2, 2), (1, 1)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(2, 3), (1, 3), (1, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 2)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 2), (2, 2), (1, 1)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(2, 3), (1, 3), (1, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 2)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 2), (2, 2), (1, 1)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(2, 3), (1, 3), (1, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 1)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 3), (2, 4), (3, 3), (2, 2)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(2, 3), (1, 3), (1, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 4)
nextLetterIndex
3
[i][j]
(2, 4)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 4), (2, 5), (3, 4)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(2, 3), (1, 3), (1, 2), (2, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 4)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 4), (2, 5), (3, 4)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(2, 3), (1, 3), (1, 2), (2, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 5)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 4), (2, 5), (3, 4)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(2, 3), (1, 3), (1, 2), (2, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 4)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 3), (2, 4), (3, 3), (2, 2)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(2, 3), (1, 3), (1, 2), (2, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 3)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 3), (2, 4), (3, 3), (2, 2)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(2, 3), (1, 3), (1, 2), (2, 4)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 2)
nextLetterIndex
4
[i][j]
(2, 2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 2), (2, 1)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(2, 3), (1, 3), (1, 2), (2, 4), (2, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 2)
nextLetterIndex
5
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 2), (2, 1)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(2, 3), (1, 3), (1, 2), (2, 4), (2, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 1)
nextLetterIndex
5
start_positions
[(0, 0), (0, 4), (0, 6), (1, 4), (1, 5), (2, 3), (4, 2), (4, 5), (4, 6), (5, 2), (5, 6), (6, 1), (7, 0), (7, 7), (9, 6), (9, 7)]
start
(4, 2)
word
daebeda
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 2), (4, 3), (5, 2), (4, 1)]
len all_neighbours
4
num_neighbours
4
lettersIndexesList
[(4, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 2)
nextLetterIndex
1
[i][j]
(3, 2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 2), (3, 3), (3, 1)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(4, 2), (3, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 2)
nextLetterIndex
2
[i][j]
(2, 2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 2), (2, 3), (2, 1)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(4, 2), (3, 2), (2, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 2)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 2), (2, 3), (2, 1)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(4, 2), (3, 2), (2, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 3)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 2), (2, 3), (2, 1)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(4, 2), (3, 2), (2, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 1)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 2), (3, 3), (3, 1)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(4, 2), (3, 2), (2, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 3)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 2), (3, 3), (3, 1)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(4, 2), (3, 2), (2, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 1)
nextLetterIndex
3
[i][j]
(3, 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 1), (4, 1), (3, 0)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(4, 2), (3, 2), (2, 2), (3, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 1)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 1), (4, 1), (3, 0)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(4, 2), (3, 2), (2, 2), (3, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(4, 1)
nextLetterIndex
4
[i][j]
(4, 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 1), (4, 0)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(4, 2), (3, 2), (2, 2), (3, 1), (4, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 1)
nextLetterIndex
5
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 1), (4, 0)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(4, 2), (3, 2), (2, 2), (3, 1), (4, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(4, 0)
nextLetterIndex
5
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 1), (4, 1), (3, 0)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(4, 2), (3, 2), (2, 2), (3, 1), (4, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 0)
nextLetterIndex
5
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 2), (4, 3), (5, 2), (4, 1)]
len all_neighbours
4
num_neighbours
3
lettersIndexesList
[(4, 2), (3, 2), (2, 2), (3, 1), (4, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(4, 3)
nextLetterIndex
5
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 2), (4, 3), (5, 2), (4, 1)]
len all_neighbours
4
num_neighbours
2
lettersIndexesList
[(4, 2), (3, 2), (2, 2), (3, 1), (4, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 2)
nextLetterIndex
5
[i][j]
(5, 2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 3), (6, 2), (5, 1)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(4, 2), (3, 2), (2, 2), (3, 1), (4, 1), (5, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 3)
nextLetterIndex
6
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 3), (6, 2), (5, 1)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(4, 2), (3, 2), (2, 2), (3, 1), (4, 1), (5, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(6, 2)
nextLetterIndex
6
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(5, 3), (6, 2), (5, 1)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(4, 2), (3, 2), (2, 2), (3, 1), (4, 1), (5, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(5, 1)
nextLetterIndex
6
[i][j]
(5, 1)
lettersIndexesList
[(4, 2), (3, 2), (2, 2), (3, 1), (4, 1), (5, 2), (5, 1)]
word
daebeda
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(3, 2), (4, 3), (5, 2), (4, 1)]
len all_neighbours
4
num_neighbours
1
lettersIndexesList
[(4, 2), (3, 2), (2, 2), (3, 1), (4, 1), (5, 2), (5, 1)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(4, 1)
nextLetterIndex
6
start_positions
[(0, 2), (0, 5), (1, 2), (1, 6), (1, 7), (2, 2), (3, 5), (3, 6), (3, 7), (4, 1), (4, 3), (4, 7), (5, 4), (5, 7), (6, 2), (6, 7), (7, 2), (7, 3), (7, 5)]
start
(0, 2)
word
edecaeabc
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 3), (1, 2), (0, 1)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(0, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 3)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 3), (1, 2), (0, 1)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(0, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 2)
nextLetterIndex
1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 3), (1, 2), (0, 1)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(0, 2)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 1)
nextLetterIndex
1
start_positions
[(0, 2), (0, 5), (1, 2), (1, 6), (1, 7), (2, 2), (3, 5), (3, 6), (3, 7), (4, 1), (4, 3), (4, 7), (5, 4), (5, 7), (6, 2), (6, 7), (7, 2), (7, 3), (7, 5)]
start
(0, 5)
word
edecaeabc
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 6), (1, 5), (0, 4)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(0, 5)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 6)
nextLetterIndex
1
[i][j]
(0, 6)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 7), (1, 6)]
len all_neighbours
2
num_neighbours
2
lettersIndexesList
[(0, 5), (0, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 7)
nextLetterIndex
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 7), (1, 6)]
len all_neighbours
2
num_neighbours
1
lettersIndexesList
[(0, 5), (0, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 6)
nextLetterIndex
2
[i][j]
(1, 6)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 7), (2, 6), (1, 5)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(0, 5), (0, 6), (1, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 7)
nextLetterIndex
3
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 7), (2, 6), (1, 5)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(0, 5), (0, 6), (1, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 6)
nextLetterIndex
3
[i][j]
(2, 6)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 7), (3, 6), (2, 5)]
len all_neighbours
3
num_neighbours
3
lettersIndexesList
[(0, 5), (0, 6), (1, 6), (2, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 7)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 7), (3, 6), (2, 5)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(0, 5), (0, 6), (1, 6), (2, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(3, 6)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(2, 7), (3, 6), (2, 5)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(0, 5), (0, 6), (1, 6), (2, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(2, 5)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(1, 7), (2, 6), (1, 5)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(0, 5), (0, 6), (1, 6), (2, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 5)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 6), (1, 5), (0, 4)]
len all_neighbours
3
num_neighbours
2
lettersIndexesList
[(0, 5), (0, 6), (1, 6), (2, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(1, 5)
nextLetterIndex
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 6), (1, 5), (0, 4)]
len all_neighbours
3
num_neighbours
1
lettersIndexesList
[(0, 5), (0, 6), (1, 6), (2, 6)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
neighbour_position
(0, 4)
nextLetterIndex
4
start_positions
[(0, 2), (0, 5), (1, 2), (1, 6), (1, 7), (2, 2), (3, 5), (3, 6), (3, 7), (4, 1), (4, 3), (4, 7), (5, 4), (5, 7), (6, 2), (6, 7), (7, 2), (7, 3), (7, 5)]
start
(1, 2)
word
edecaeabc
^^^^^^^^^^^^^^^^^^^^^^^^^^^
main loop all_neighbours
[(0, 2), (1, 3), (2, 2), (1, 1)]
len all_neighbours
4
num_ne