so if I try to write xw[ACROSS, 2] = 'bad' I will get a ValueError in crossword.py, line 500 because the length mismatch. If I try to pad it with chars, however (for instance writing xw[ACROSS, 2] = 'badt' I will get an IndexError in crossword.py, line 104 (triggered from line 516 in the same file).
Hello
I found an issue with this library.
When there is a word followed by a black, a letter and a black (because that letter is part of a down word) then the word is not calculated correctly.
Here is a minimum example:
This script outputs:
As you can see, the library correctly numbers the words, but then assigns the 'C' letter to word Across 2.
In fact, this is because the
_parse_grid
function incorrectly labels the cells. This is the value ofxw._across
in the previous example:This is even worse when not providing a pre-filled grid. For instance in this similar example:
which generates this crossword:
In this case, you will not be able to ever write across 2. The word is a 4 chars one, since
xw._words
isso if I try to write
xw[ACROSS, 2] = 'bad'
I will get a ValueError in crossword.py, line 500 because the length mismatch. If I try to pad it with chars, however (for instance writingxw[ACROSS, 2] = 'badt'
I will get an IndexError in crossword.py, line 104 (triggered from line 516 in the same file).This is as far as I managed to dig in the code.
Do you think this can be solved?