viresh-ratnakar / exolve

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

Use "-" as a letter. At least in a prefilled square. #42

Closed erikstar closed 3 years ago

erikstar commented 3 years ago

Hi!

I was just about to create a board with exolve for the last week "Swedish National Radio: Melodikryss" and then try to write to The Swedish national Radio with a small feature request to use exolve instead of their own lousy system... I admit a bit naive... but one can try :-)

https://sverigesradio.se/sida/artikel.aspx?programid=2078&artikel=723047

What I wanted to point out is two things they are missing: 1) Typing text in "turning words" doesn't "turn". 2) I wanted to use "linked clues". In this kinds of sound based crosswords it can be a bit difficult to remember all places on the board when the question is multi word solutions... it is hard to remember all the places on the board when the question is asked and the music starts. So the nice feature with linked clues marked on the board (as exolve has) should really help.

And now to my problem... as you see in the link for the last week puzzle, they sometimes use a prefilled square with a "-". It should be wonderful to have that character handled as a letter... at least in the exolve-grid. If I understand stuff the "-" is not any decorator -- at least not yet :-) So this first line should be super for me to use: "0000000-!00".

I understand that I could modify your last function with placing hyphens almost anywhere, but in this case where I want to convince "them" about how simple to convert to exolve -- it would be great if it was just simple :-)

/Erik S

viresh-ratnakar commented 3 years ago

I have a an exolve-option ("allow-digits") to allow having numerals in grids. I can add a similar exolve-option to add arbitrary letters to the set of allowed letters. So you will then do something like:

exolve-option: allow-chars:-

However, doing it this way will also allow solvers to type a "-" in any square. Does that work for these puzzles?

erikstar commented 3 years ago

Yes please! That would be perfect!

erikstar commented 3 years ago

But now I realize it would be some kind of contradiction with your special handling of "0". But if you go "all in" for the change to "?" instead of "0" I guess it should work.

erikstar commented 3 years ago

But I could really live with your suggested "exolve-option: allow-chars:" and just use some other unicode version of hyphen...

erikstar commented 3 years ago

Or use a "space" and use your new function "addCellText" for the hyphen.

viresh-ratnakar commented 3 years ago

I've (finally!) added the allow-chars option in v1.08. Here's the documentation:

I also changed the implementation of dealing with 0 and 1 when allowed through allow-digits (making that use the same code as allow-chars)