-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbartez_remote_dbg.py
More file actions
36 lines (25 loc) · 857 Bytes
/
Copy pathbartez_remote_dbg.py
File metadata and controls
36 lines (25 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import ptvsd
ptvsd.enable_attach("bartez", address = ('0.0.0.0', 3500))
ptvsd.wait_for_attach()
from bartez import boards
from bartez.crossword import Crossworld
from bartez.crossword import SquareValues
from bartez.solver import CrosswordSolver
from bartez.word_dictionary import Dictionary
def get_dictionary():
return Dictionary("italian", "words.txt")
def main():
dictionary = get_dictionary()
print("done")
print("words count: ", dictionary.get_words_count())
board, geometry = boards.get_default_board()
crossword = Crossworld(geometry[0], geometry[1])
for p in board:
r, c = p[0], p[1]
crossword.set_value(r, c, SquareValues.block)
crossword.prepare()
crossword.print_crossword()
solver = CrosswordSolver(dictionary, crossword)
solver.run()
if __name__ == "__main__":
main()