4 ms·
Can you explain what you are seeing about "B" that does not match? Or about "_______"?
by freeopinion 6y ago
Can you explain what you are seeing about "B" that does not match? Or about "_______"?
- ladberg 6y agoI agreed that "B" does match. However, the puzzle needs to match the full line and not just a substring so "ZZZZZZ" or "B " don't.
- freeopinion 6y agoYou have not explained how those are not matching the full line. I assert that they are. Show me actual correct code that says otherwise.
- chaorace 6y agoAs you can see[1], the regex checker is based on the JS RegExp.match method. Each cell is always 1 character long (so, either a letter of some kind or an empty space). The str parameter for the check function is assembled by concatenating these cells together[2], so the input string for an empty line will look something like this: "_______" Assuming an empty 7-cell row, the regex in question will match 7 times, once for each character. A result of multiple partial matches is not equivalent to getting just one perfect match, which is what the puzzle requires. Internally, the puzzle enforces this requirement by making each Regex rule require a full line match (see line 118: '^' + rule + '$'). Personally speaking, I felt like that was the most intuitive way to interpret the mechanics of the game, so I'm willing to give the programmer a pass when they slightly modify the regex rule prior to evaluation. [1]:https://github.com/Jimbly/regex-crossword/blob/8b178f32eba3799146fd5fdbe286e34d7cfe9e59/crossword.js#L116-L128 https://github.com/Jimbly/regex-crossword/blob/8b178f32eba37... [2]:https://i.imgur.com/PS0BmJ6.png https://i.imgur.com/PS0BmJ6.png