> In order to remember which puzzles you have solved, we need to identify you in some way.
No, that's a lie. No need for identification in order to save progress, you can use: cookie, browser storage, etc.. for that.
Please be honest about why you are using social media for login. Because when I login with Facebook for example, you can see a large portion of my Facebook profile and depending on the plan you have way more than that.
I like when this kind of sites allow you to copy-paste your sessions (as in a cookie clicker game), but (serious question) what they say is true if you want synchronized saves from multiple browsers/devices?
For saving your settings, Duck Duck Go gives you a random unique "passphrase" that is both identity and authentication, and also uses cookies so you don't have to input it every visit. It seems to work well.
Using cookies is brittle because they can get purged. They also don't sync. You could display some base64 encoded data to copy and paste between sessions but that would be quite unpleasant.
One way would be to auto-generate accounts and display some random identifier to keep. Or maybe just offer e-mail to which they would send you a login link... There are other options but login with OAuth is not the worst.
> Please be honest about why you are using social media for login.
Without speaking for Regex Crossword (I'm in no way affiliated with them):
I suspect the reason may at least in part be security. Passwords are dangerous to keep around, hard to handle, computationally expensive if done right, and if an attacker gets at the database, people get angry. A social network provider (especially the options here, Facebook, Google, Twitter, GitHub and Windows Live) is much more likely to get security (against third party attackers) a lot more right.
That's just foolish - you don't need passwords of any kind. In fact you don't need accounts. You can just store cookies, accessible from this browser only, which tells you what have you solved.
That doesn't solve login in from a different device. And if you cleanup cookies for whatever reason, you lost the progress. So no, cookies don't solve the same problem as a user account (with login from a "trusted" provider) solves for saving the state of progress by a user on this game.
Maybe allow both options for people who want to keep their saves across multiple devices and one for users that use the same browser. It is a pretty trivial thing to do.
Not everyone has nefarious plans. Some people want to simplify the process for both parties. You have valid points, but there's no need to be so aggressive.
I'm not so certain, supporting saving data to a URL hash is pretty trivial to do, much easier than going with SSO integration - so I'm surprised the site doesn't support both at least.
URL hashing is annoying. It ends up transferring to someone else if you copy+share the link, and it disappears if you leave the site and come back later.
It already saves your answers in local storage, when you open the page in a new tab your progress is gone but your solutions are still there. You just have to click "Validate" for each of them. So the authors know it's a lie.
Ah, this brings me back. I remember coming across these a few years ago and spending a ton of time solving them. I wound up taking a crack at writing a regex crossword solver. Suprisingly a solver that used basic constraint satisifcation[0] was enough to solve every problem I threw at it.
The core idea was for each cell, keep track of a list of possible letters that can go there. Initially you start with the full alphabet, and as the solver repeatedly narrows down the list for each cell as it gets closer and closer to completion. To hone in on the solution, the solver would iterate through each regex and see what characters could go in that row or column to match the regex.
For example if you have the regex "(a|b)" against an cell, you can constrain the list of possible values to the cell to just the letters "a" and "b". For a slightly more complex example, if you are matching a regex "(abc|def)", and you know the middle character has to be an "a" or a "b", you know the string in that row or column is "abc". By repeatedly checking each regex, the solver gets closer and closer to the solution until it eventually solves it.
Of course there's a chance the solver will get stuck. As a last resort, you can always resort to backtracking. I wound up finding implementing backtracking wasn't necessary since the approach I mentioned above was enough to solve every puzzle I threw at the solver.
I did the somewhat bruteforcy generate-strings-and-learn-from-that way, instead of working off the parse tree. The latter is clearly more efficient, but also not something I can implement in <1h before work -- and it has the logic engine in the center, meaning it's not a dead end if I want to pick it up again :-)
Not sure how you're managing that, A is the answer to the first tutorial, but doesn't work for the second one.
If you click Validate it'll shake and turn red, though you can skip ahead all you want, you want it to turn green and add a checkmark next to the title.
Yeah, some of the puzzles in Beginner seem to imply they need more than one character entered, but you can only enter a single character. `EP|IP|EF` matches those pairs literally, so I'm not sure what it wants me to enter if it only accepts one character.
I'm no regex beginner but this overall presentation is pretty confusing.
That example you gave is from the first Beginner puzzle, correct? There are two spaces to fill in. So one of those three sequences is the answer to that column (or row if you've rotated the puzzle). There's not an error.
If you find the interface confusing, start with the tutorial levels which begin with a single character solution and progress to larger solutions. Each cell is clearly meant to be one character in a string, with the row/column being the entire string.
This is great but I think it would be more interesting the other way round: write regex to capture complex input. Maybe add some steps constraints to up the difficulty.
This is a great, fun way to learn! Two points for improvement, in case the creators are reading:
1) It's not clear which flavour/implementation is needed. I was using https://regex101.com/ to check until the puzzle where /+ is used, which that site claims is invalid in JS and PHP but OK in Python.
2) It would be great if filling a cell automatically moved you to an adjacent cell, as in most (regular) crossword apps.
Ah, I missed that. That really compounds the question though: I see that they explicitly recommend regex101, which claims that the clue is invalid JS regex
Pasting that into regex101, with flavour Ecmascript, yields "Pattern Error" (rightly, since forward slashes enclose patterns, and thus need to be escaped).
Maybe it's just me but I find it immensely more difficult to solve the ones where the regex is rotated 90 degrees. Something about trying to write a thing left-to-right and mentally match it with a thing reading top-to-bottom is exercising a (clearly untouched) part of my mental pathways. I'd love for the top row to not be rotated it'd be much more fun.
Right now, it works using a logic programming engine (core.logic, essentially miniKanren), generating a bunch of strings that match the regex, and then applying them as constraints.
If I were to improve it, I'd parse the regex, walk the parse tree, and assign constraints that way. (There's already a regex parser in there: that's how the string generation works.) That was my first thought, but that's more complex than what I want to tackle before work :)
Right now there's a bug where if e.g. a regex AB|CD will get applied character-wise, so it might erroneously try AC or BD. The way to fix that is to make sure the answers actually match the regex all the way at the end.
Using a constraint engine has the cool feature that it can show you multiple answers if they exist. (That's not true for my current implementation, because the string generation is randomized, so there's no guarantee it will visit each possible string.)
Someone else has pointed out that there are a lot of clues in the titles, e.g. that the answers are palindromes. That would be easy to add:
(map (fn [vars] (l/== vars (reverse vars))) (concat rows cols))
(Read: "for each row and col, create a constraint that the row/col must be equal to itself reversed".)
A while back I wrote a little Rust library that does exactly what you say: parses a regex to use as a text generator. It was a lot of fun, and really gives you an appreciation for just how much bigger than ASCII matching the regex world can be! Writing a constraint-based solver that uses the generator library sounds like an amusing project as well!
60 comments
[ 4.1 ms ] story [ 133 ms ] threadPrevious discussion: https://news.ycombinator.com/item?id=8674039
surprised that this resource wasn't mentioned in a recent thread [2] about regex
[1] https://regexcrossword.com/about
[2] https://news.ycombinator.com/item?id=20614847
Perhaps I have some time in 2-3 weeks to develop it further, does anybody have advice on what to include?
https://play.google.com/store/apps/details?id=de.chagemann.r...
No, that's a lie. No need for identification in order to save progress, you can use: cookie, browser storage, etc.. for that.
Please be honest about why you are using social media for login. Because when I login with Facebook for example, you can see a large portion of my Facebook profile and depending on the plan you have way more than that.
Anyway the Idea is good and it is really fun to solve.
One way would be to auto-generate accounts and display some random identifier to keep. Or maybe just offer e-mail to which they would send you a login link... There are other options but login with OAuth is not the worst.
Without speaking for Regex Crossword (I'm in no way affiliated with them):
I suspect the reason may at least in part be security. Passwords are dangerous to keep around, hard to handle, computationally expensive if done right, and if an attacker gets at the database, people get angry. A social network provider (especially the options here, Facebook, Google, Twitter, GitHub and Windows Live) is much more likely to get security (against third party attackers) a lot more right.
Better to just save to a cookie.
The core idea was for each cell, keep track of a list of possible letters that can go there. Initially you start with the full alphabet, and as the solver repeatedly narrows down the list for each cell as it gets closer and closer to completion. To hone in on the solution, the solver would iterate through each regex and see what characters could go in that row or column to match the regex.
For example if you have the regex "(a|b)" against an cell, you can constrain the list of possible values to the cell to just the letters "a" and "b". For a slightly more complex example, if you are matching a regex "(abc|def)", and you know the middle character has to be an "a" or a "b", you know the string in that row or column is "abc". By repeatedly checking each regex, the solver gets closer and closer to the solution until it eventually solves it.
Of course there's a chance the solver will get stuck. As a last resort, you can always resort to backtracking. I wound up finding implementing backtracking wasn't necessary since the approach I mentioned above was enough to solve every puzzle I threw at the solver.
[0] https://en.wikipedia.org/wiki/Constraint_satisfaction_proble...
I did the somewhat bruteforcy generate-strings-and-learn-from-that way, instead of working off the parse tree. The latter is clearly more efficient, but also not something I can implement in <1h before work -- and it has the logic engine in the center, meaning it's not a dead end if I want to pick it up again :-)
If you click Validate it'll shake and turn red, though you can skip ahead all you want, you want it to turn green and add a checkmark next to the title.
I guess all I showed was that if you don't want to learn, you're not gonna learn.
I'm no regex beginner but this overall presentation is pretty confusing.
If you find the interface confusing, start with the tutorial levels which begin with a single character solution and progress to larger solutions. Each cell is clearly meant to be one character in a string, with the row/column being the entire string.
Don't do that people. Just. Don't.
Keep regexes simple and stupid! Remember other people will have to read them someday.
After that, keep regex101.com handy for testing and checking your regexes.
1) It's not clear which flavour/implementation is needed. I was using https://regex101.com/ to check until the puzzle where /+ is used, which that site claims is invalid in JS and PHP but OK in Python.
2) It would be great if filling a cell automatically moved you to an adjacent cell, as in most (regular) crossword apps.
[1] https://regexcrossword.com/about
not sure about the question you hit a snag, can you post the details here? you might get your doubt cleared
Pasting that into regex101, with flavour Ecmascript, yields "Pattern Error" (rightly, since forward slashes enclose patterns, and thus need to be escaped).
and yeah, agree with you, this should either be escaped or some explanation added regarding delimiters
Right now, it works using a logic programming engine (core.logic, essentially miniKanren), generating a bunch of strings that match the regex, and then applying them as constraints.
If I were to improve it, I'd parse the regex, walk the parse tree, and assign constraints that way. (There's already a regex parser in there: that's how the string generation works.) That was my first thought, but that's more complex than what I want to tackle before work :)
Right now there's a bug where if e.g. a regex AB|CD will get applied character-wise, so it might erroneously try AC or BD. The way to fix that is to make sure the answers actually match the regex all the way at the end.
Using a constraint engine has the cool feature that it can show you multiple answers if they exist. (That's not true for my current implementation, because the string generation is randomized, so there's no guarantee it will visit each possible string.)
Someone else has pointed out that there are a lot of clues in the titles, e.g. that the answers are palindromes. That would be easy to add:
(Read: "for each row and col, create a constraint that the row/col must be equal to itself reversed".)Link: https://github.com/CryptArchy/regex_generate
When done, go to http://alf.nu/RegexGolf to sharpen up your skill!
https://en.wikipedia.org/wiki/The_Hitchhiker%27s_Guide_to_th...