-
Notifications
You must be signed in to change notification settings - Fork 98
Open
Description
I'm not sure if there's already a way to do this and I'm just missing it... in the image below, the number 19 shouldn't be there, right? There's no word that starts there, either down or across.
I'd be glad to take a look and work on this (this is an incredible tool!), I just don't want to duplicate work if there's already a way.
I believe the relevant code is here:
Lines 535 to 566 in 58243dd
| function updateLabelsAndClues() { | |
| let count = 1; | |
| for (let i = 0; i < xw.rows; i++) { | |
| for (let j = 0; j < xw.cols; j++) { | |
| let isAcross = false; | |
| let isDown = false; | |
| if (xw.fill[i][j] != BLACK) { | |
| isDown = i == 0 || xw.fill[i - 1][j] == BLACK; | |
| isAcross = j == 0 || xw.fill[i][j - 1] == BLACK; | |
| } | |
| const grid = document.getElementById("grid"); | |
| let currentCell = grid.querySelector('[data-row="' + i + '"]').querySelector('[data-col="' + j + '"]'); | |
| if (isAcross || isDown) { | |
| currentCell.firstChild.innerHTML = count; // Set square's label to the count | |
| count++; | |
| } else { | |
| currentCell.firstChild.innerHTML = ""; | |
| } | |
| if (isAcross) { | |
| xw.clues[[i, j, ACROSS]] = xw.clues[[i, j, ACROSS]] || DEFAULT_CLUE; | |
| } else { | |
| delete xw.clues[[i, j, ACROSS]]; | |
| } | |
| if (isDown) { | |
| xw.clues[[i, j, DOWN]] = xw.clues[[i, j, DOWN]] || DEFAULT_CLUE; | |
| } else { | |
| delete xw.clues[[i, j, DOWN]]; | |
| } | |
| } | |
| } | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
