viresh-ratnakar / exolve

Online interactive crossword software in JavaScript
MIT License
74 stars 15 forks source link

Feature request: change the order of "next", "previous"-clue in a generic way #50

Closed erikstar closed 3 years ago

erikstar commented 4 years ago

Hi again. Again a bit esoteric demand... but for me as a music quiz/crossword creater it is rather important. My "musikkryss" is planned with a specific order of songs. So I want the "next-button" to move to the next clue (song) even if the last one was "across" and the next one happens to be "down".

You have made it very flexibel were I can change across, down, and nodir. And I can also often achive this with changing if a light is a reference to something or something else refering to it (in grouped lights). But I can't achive what I want -- genric order.

I would be perfectly happy with some concrete examples how I can achive this with some really ugly functions in customizeExolve to reorder it, because I understand that you don't wan't to add some extra notation for just this demand.

Anyway. It would really bli great for melody crosswords makers.

Thanks! /Erik S

viresh-ratnakar commented 3 years ago

[Getting to this after a long time, apologies!]

I think modifying the data structures to achieve this is doable but a bit too complicated: you'd have to modify the next/prev pointers in each grid cell (grid[][].nextA, grid[][].nextD) as well as in each clue (clue[].next). You can inspect these properties in the JavaScript console to see how to set them.

For activating the first clue, you can simply call cnavTo() at the end of customizeExolve(). This example will start at 12-across:

function customizeExolve(puz) {
  puz.cnavTo('A12')
}