pmaher86 / blacksquare

A Python package for crossword creators.
MIT License
38 stars 13 forks source link

Word numbers are incorrect #12

Closed wom-bat closed 1 year ago

wom-bat commented 1 year ago

Try this:

from blacksquare import *

xw =  Crossword(15, display_size_px=200)
for x in [(0,0), (1,0), (3,0), (5,0), (7,0), (9,0), (11,0),(13,0),
               (5,1),
               (1,2), (3,2), (5,2), (7,2), (9,2), (11,2), (13,2),
               (7,3),
               (1,4), (3,4), (5,4), (7,4), (9,4), (11,4), (13,4), (14,4),
               (5,5),
               (1,6), (3,6), (4,6), (5,6), (6,6), (7,6), (9,6), (11,6), (12,6), (13,6),
               (7,7)]:
    xw[x] = BLACK
    xw.pprint(numbers=True)

I expect '2' (for 2-down) in the 4th square from the left in the top row. Instead it's where it's blocked by a black square. The grid is the one used by Guardian Crossword No 28,834 https://www.theguardian.com/crosswords/cryptic/28834

pmaher86 commented 1 year ago

I should probably specify in the docs, but I hadn't intended to cover cryptic crosswords--the assumption in a standard (American?) crossword is that every cell is checked.

wom-bat commented 1 year ago

I think it's a worthwhile addition anyway --- the every-light-checked case will still work.