Closed erikstar closed 4 years ago
And now I realize I could even like an option to place the hyphen before the first letter also.
/Erik S
Oops. I now see "!" is already used... but perhaps ":" or something...
2, 3 This should be a-b cde-f (1-1, 3-1)
that should work I think.
3, etc. I think you can simply write a function to place a hyphen wherever you want, and call it from customizeExolve(). This would be similar to the function that I had sketched for placing the "turning" symbol. Below is a (slightly modified so that you can adapt it) copy of the relevant part of code that creates hyphens:
let gridCell = puz.grid[row][col]
if (gridCell.hyphenToRight) {
const hyphenRect =
document.createElementNS('http://www.w3.org/2000/svg', 'rect');
hyphenRect.setAttributeNS(null, 'x',
puz.cellLeftPos(col + 1, puz.GRIDLINE - puz.hyphenWBy2));
hyphenRect.setAttributeNS(null, 'y', puz.cellTopPos(
row, puz.GRIDLINE + puz.squareDimBy2 - puz.SEP_WIDTH_BY2));
let hw = (col + 1) < puz.gridWidth ? puz.hyphenW : puz.hyphenWBy2
hyphenRect.setAttributeNS(null, 'width', hw);
hyphenRect.setAttributeNS(null, 'height', puz.SEP_WIDTH);
hyphenRect.style.fill = puz.colorScheme['separator']
puz.svg.appendChild(hyphenRect)
}
if (gridCell.hyphenBelow) {
const hyphenRect =
document.createElementNS('http://www.w3.org/2000/svg', 'rect');
hyphenRect.setAttributeNS(null, 'x', puz.cellLeftPos(
col, puz.GRIDLINE + puz.squareDimBy2 - puz.SEP_WIDTH_BY2));
hyphenRect.setAttributeNS(
null, 'y', puz.cellTopPos(row + 1, puz.GRIDLINE - puz.hyphenWBy2));
hyphenRect.setAttributeNS(null, 'width', puz.SEP_WIDTH);
let hh = (row + 1) < puz.gridHeight ? puz.hyphenW : puz.hyphenWBy2
hyphenRect.setAttributeNS(null, 'height', hh);
hyphenRect.style.fill = puz.colorScheme['separator']
puz.svg.appendChild(hyphenRect)
}
Thank you for the "3". Then I can fiddle with stuff in a generic way.
I totally understand your "2". Sounds resonable. Very special demand from me...
But the "1"... I wonder if it is some kind of bug then...
At least my "2, 3 linked (1-1 2-2)" from my example: https://fripp.changeip.org/melodikryss/melodikryss1/index_clues.html (2d, 3d) does only give one hyphen in the two words (2d, 3d).
Yes, thanks, this does look like a bug! I will fix it.
I looked into the code to fix this "bug", but realized that I had a typo above, unfortunately.
It should be (1-1, 2-2) (there should be a comma to indicate a space, as is usual in crosswords). I have also updated it in my comment above.
OK. But for me it doesn't work with: 2, 3 linked (1-1, 2-2) or 2, 3 linked (1-1,2-2)
Without comma the first hyphen shows.
With comma the whole puzzle disappears.
Ah, this is indeed a bug that I can see now, but for now there is a workaround for you. If you also add 3d in your down clues, with any dummy text, it should work. For example:
exolve-down:
2,3 linked (1-1, 2-2)
3 see 2d
With v0.90 that I have now checked in, the hyphen in the linked clue should get rendered even if the linked clue is not explicitly listed in the list of clues.
For me all this is perfectly solved in 0.95.
Hi!
First: for me hyphen placement is more a physical thing that I spontaneously should let the "exolve-grid" handle. With something like "-" or "!" after a letter.
But with your design I have some questions: 1) How to make a hyphened word in a multiword clue (except the first word)? https://fripp.changeip.org/melodikryss/melodikryss1/index_clues.html (2d, 3d)
2) Is it a bug or a feature that the hyphen exist in 20d? For me it is definitely be a feature! So for me it would be great if the hyphen wasn't chopped. (I needed it in a swedish name "Sven-Erik")
3) Is it possible to add hyphen in nodir clues?
Thanks! /Erik S