From 2c0ce4c9e13454eef6dbf3aad04d389bc5852b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20S=2E=20Martins?= Date: Tue, 17 May 2016 23:12:04 +0100 Subject: [PATCH] Code cleanup. Remove unnecessary test case. --- crossword_generator.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/crossword_generator.py b/crossword_generator.py index 5349d29..2029080 100755 --- a/crossword_generator.py +++ b/crossword_generator.py @@ -226,26 +226,18 @@ def write_grid(grid, screen=False, out_file="table.tex"): # TODO -# Test cases -def test_write_grid(): - # Sample grid - grid = [["a", "b", "c", "p"], - ["e", "k", "l", "ç"], - ["s", "g", "e", "ã"], - ["s", "g", "e", "ã"], - ["s", "g", "e", "ã"], - ] - - # Write to screen and file - write_grid(grid) - write_grid(grid, True) - if __name__ == "__main__": + # Read words from file words = read_word_list("words.txt") - #print(words) + + # Generate grid grid = generate_grid(words, [20,20]) + + # Show grid print("Final grid:") write_grid(grid[0], True) print("Words:") pprint.pprint(grid[1]) - #test_write_grid() + + # Print to file and compile + write_grid(grid[0])