-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix numbering of words #13
Conversation
Please note, it appears that the
Without the changes yields a grid full of J; with the changes yields a python backtrace. |
The latest commit fixes the fill() backtrace. The remaining problem is that sometimes words are repeated in the grid. |
This case now works, but repeats the word 'Wax' |
The latest commit prevents word reuse. |
Thanks for the contribution! This gets to a bigger distinction though: the differences between cryptic and non-cryptic crosswords. Because they have different rules and expected structure, I think it would be preferable to have this behavior controlled via either a property of the Crossword class ( |
It's not just cryptic crosswords. Any crossword can have black squares anywhere. In British parlance, a non-cryptic crossword is a 'quick' crossword --- see, e.g., https://www.theguardian.com/crosswords/quick/16314 Please note --- grids with all lights checked will still work. There's no change in behaviour there. |
The algorithm used to look for black squares to the left or above a possible word. This patch checks that the resulting word is longer than one character. Signed-off-by: Peter Chubb <[email protected]>
The previous change fixed the numbers, but didn't adjust the _across and _down arrays to be correct. SIgned-off-by: Peter Chubb <[email protected]>
Make Crossword.get_word_at_index() return None if there is no word. Make the matching code cope with None returns. Signed-off-by: Peter Chubb <[email protected]>
This is not true of American crosswords; they require that all words are at least three letters and all cells are checked. In any case, I agree this numbering logic is compatible with those as well. More work may be needed if/when grid validation is implemented. |
Thanks for the contribution. Feel free to merge! |
The algorithm used to look for black squares to the left or above a
possible word. This patch checks that the resulting word is longer
than one character.
This fixes bug #12
Signed-off-by: Peter Chubb [email protected]