Skip to content
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

Clues & numbering for non-Times grids #16

Open
dnapoleoni opened this issue Sep 1, 2018 · 1 comment
Open

Clues & numbering for non-Times grids #16

dnapoleoni opened this issue Sep 1, 2018 · 1 comment

Comments

@dnapoleoni
Copy link

Loving this program! I know it's designed for NY Times grids but I'm trying to use it for an Aussie/British style layout and it's having problems working out where the clues are. I've taken a browse through the code and it seems that it's only checking whether the previous square is black before deciding there's a clue there - which in the rest of the world's grids means a whole lot of extra numbers.

I've attached a demo .pdf to show what I mean: blank-grid.pdf

I've taken a look at the code and I think I've worked out a simple fix, one that checks whether a black square is before AND after each white square before determining its viability. This should still leave the NY-times version unchanged while supporting other grid layouts!

cross.js, lines 542 & 543:

isDown = i == 0 || xw.fill[i - 1][j] == BLACK && i == xw.rows - 1 || xw.fill[i + 1][j] != BLACK; 
isAcross = j == 0 || xw.fill[i][j - 1] == BLACK && j == xw.cols - 1 || xw.fill[i][j + 1] != BLACK;

Hope it helps,
Dan

@dnapoleoni
Copy link
Author

I finally worked out how to fork and set up your repo and just added the changes myself - including a few extra minor UI/navigation tweaks and an undo/redo history stack!

Check it out here and let me know what you think - it should still be working for the regular NYT-style puzzles as well as accommodating other styles with numbering intact.

Happy to send the changes over in a pull request if they're something you're keen to fold into the original master! Not really sure how to do that exactly but can look it up.

Cheers,
Dan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant