14 ms·
RegEx Crossword
- jedberg 6y agoOh man. This broke my brain just trying to get one of them without breaking all of the ones that crossed it. I love this.
- Minor49er 6y agoThis is awesome. I wish there was a way to rotate the cells so you could see them straightened out. Otherwise, this is like the final boss to every Regex Golf game I've seen
- WarOnPrivacy 6y agoWell, there went my weekend.
- Naac 6y agoAny reason why this is implement as a hex instead of the traditional crossword style? There isn't a technical reason why the traditional crossword format can't have clues in the shape of regex right?
- neolog 6y agoDoes the hex mean each cell has more adjacencies?
- kjhughes 6y agoThe hexagonal layout allows three regex constraints to be imposed on each cell rather than two for a rectangular layout, providing additional challenge.
- ZeroGravitas 6y agoDon't think there's a technical reason. I'd previously seen this site linked from here that does it slightly more traditionally: https://regexcrossword.com/ https://regexcrossword.com/
- minitoar 6y agoIIRC the more advanced puzzles here are also hexagonal.
- freeopinion 6y agoLost interest on 3rd beginner puzzle when validation failed for multiple valid solutions.
- vitus 6y agoWhat solutions were you trying? As far as I can tell, the puzzle is fully constrained. From the start, the bottom-left cell as well as the right column can be solved just from the starting hints, and then you can derive the top-left cell per the backreference. In particular, you can reframe the right column's hint as (AB|OO|OR), and only one of those satisfies the bottom row's hint.
- freeopinion 6y agoNot so. Something as simple as "OO\nDO" should be valid. But also "OO\nDD" and myriad other solutions.
- vitus 6y agoAh. The difference is that you're trying partial matches, as opposed to full matches from the specified patterns. edit: and by full match (since this seems to be the source of some confusion in another subthread), I explicitly mean anchored with your \A...\Z or whatever you want to use.
- deleted 6y ago[deleted]
- lesquivemeau 6y ago"Hexagons are the bestagons"
- ehsankia 6y agoThere are plenty of normal regex crosswords out there. What makes this one special is the fact that it's in a hex format. If anything, regex is actually what allows people to even make hexagonal crosswords, I don't think it would possible to get any reasonably sized one with normal words. They just went the extra mile to make an special puzzle.
- glsdfgkjsklfj 6y ago99pct of the challenge is counting the positions for things. Would be nice if they had a couple hand mande puzzles instead of random ones.
- smrq 6y agoThere is no way a puzzle with such a narrow solution path is anything but handmade.
- anderskaseorg 6y agoThis puzzle was originally written by Dan Gulotta for the 2013 MIT Mystery Hunt. https://web.mit.edu/puzzle/www/2013/coinheist.com/rubik/a_regular_crossword/ https://web.mit.edu/puzzle/www/2013/coinheist.com/rubik/a_re...
- anderskaseorg 6y ago(I got this attribution fixed upstream: https://github.com/Jimbly/regex-crossword/pull/7 https://github.com/Jimbly/regex-crossword/pull/7.)
- superfamicom 6y agoThese sort of games are great as an educational tool, a simpler one would be a nice intro before going to hard mode though.
- tzury 6y agoRegex Golf used to be my game https://alf.nu/RegexGolf https://alf.nu/RegexGolf
- walnut_eater 6y agoHmm, I can't quite figure out the syntax. It seems to do partial matching and it ignores my use of ".*".
- ufo 6y agoIs it supposed to have an unique solution or are multiple solutions possible?
- hateful 6y agoAlso, are the answers real words, or random strings?
- ufo 6y agoIt has to be fake words. It's possible to see this because some of the words have to contain things like "cdd", "rrp" and "rxo", which aren't part of any real words.
- hateful 6y agoPlus, now that I think about it, having a grid without the gaps usual crosswords have would be very complex to create with actual words. Even more so when using hexagons.
- deleted 6y ago[deleted]
- ladberg 6y agoJust did it, there's a unique solution and you can get to it just by considering a few rules at a time (i.e. no long backtracking).
- sevencolors 6y agoThe solution: https://www.i-programmer.info/images/stories/News/2014/Dec/B/regsolution.jpg https://www.i-programmer.info/images/stories/News/2014/Dec/B... Aren't crosswords supposed to spell out a word? This feels like random characters. Unless i'm supposed to rotate it or something?
- mypalmike 6y agoThink sudoku rather than crossword.
- ineptech 6y agoThis is an absolute classic! It is not just an exercise in tedium or repetition, it has an internal progression that makes it very satisfying to solve.
- cammil 6y agoJust the right amount of difficulty before you get rewarded. Like pistachios.
- reificator 6y agoSo many of these start or end with an `x*`, `(x|y)`, `[xy]` or `[^xy]` that I only see two characters I can fill in before I need to start looking at multiple constraints for the same cell and either doing combinatorics or guess-and-check. This might be fine for hard mode, but as someone who considers themselves a regexpert it's not very approachable as a first puzzle IMO. A more gradual introduction to the format would be to give a few clues that give you confidence on specific characters, that then let you lock in some other characters in other hints, and so on. For instance, replacing `.*H.*V.*G.*` with `.{3}H.*V.*G.*` would go a long way because you could confidently place an `H`. And say that intersected with `(DI|NS|TH|OM)*` on the `H`, you could then place a `T` from the second clue because of what you learned from the first clue. It could just be that I'm missing something or not as good at regex as I thought, and please let me know if that's the case. Either way though, when I'm trying a new kind of puzzle I'd like to feel like I made some sort of progress after trying for 5-10 minutes, and here 2 chars does not feel like progress.
- afranchuk 6y agoI just completed it, and can say with certainty that it is solvable by only taking into consideration two constraints at any given time, with the exception of 3 at just one point early on (and they were the easier constraints in the puzzle). That being said, the nature of regex means you kind of need to jump around as far as which constraints you combine.
- hk__2 6y agoSee also https://regexcrossword.com/ https://regexcrossword.com/, which has been discussed a lot on HN.
- carstenhag 6y agoAlso, my android version of it: https://play.google.com/store/apps/details?id=de.chagemann.regexcrossword https://play.google.com/store/apps/details?id=de.chagemann.r... https://gitlab.com/carstenhag/regex-crossword-kotlin https://gitlab.com/carstenhag/regex-crossword-kotlin
- mvolfik 6y agoI hate you. I've just spent there way more time than I'd want to admit
- ehsankia 6y agoSmall feature request for this implementation: Highlight/bold the three impacted regex when selecting a given hexagon, trying to trace it manually by eye is a bit of a pain. (I guess I could PR on github when I get some time later today)
- ehsankia 6y agohttps://github.com/Jimbly/regex-crossword/pull/10 https://github.com/Jimbly/regex-crossword/pull/10
- beaconstudios 6y agoI was just finishing my implementation of this in the console when I saw your comment!
- Jimbly 6y agoMerged, thanks!
- TheCycoONE 6y agoUnfortunately they mixed up the coordinates a little. I submitted a fix.
- adrianmonk 6y agoYour fix is appreciated. It's much nicer not to have to ignore the label highlighting across the top when clicking in rows below the middle.
- wutbrodo 6y agoThanks for the PR! I noticed that little detail and probably wouldn't have completed the puzzle without it.
- heroHACK17 6y agoOmg
- gotostatement 6y agoWhy doesnt the empty string satisfy `(DI|NS|TH|OM)*`?
- freeopinion 6y agoEmpty string does satisfy that. This puzzle gets it wrong.
- vitus 6y agoThat's because it's not empty string in the puzzle, it's 8 spaces. (and on top of that, we're doing a full match.)
- freeopinion 6y ago8 spaces also matches. I don't know what you mean by a full match. Do you mean that you are using a different RegEx than the one displayed?
- nxrabl 6y agoI assume by 'full match' they mean: - the pattern is found in the input - the start of the match is the start of the input - the end of the match is the end of the input By this definition, 8 spaces does not match the pattern.
- freeopinion 6y agoI don't know what any of your three statements actually mean. R*D*M* does not specify anything that has to be found in the string. Nor does any pattern of ()* or []* no matter what you put between the parens or brackets. In all of those cases, any possible string matches the regex starting at the beginning of the string and ending at the end of the string. Your clarification doesn't clarify anything for me.
- deleted 6y ago
- onion2k 6y agoIf you fancy making an online crossword, I once made a nice traditional crossword layout using CSS Grid that makes a decent basis - https://codepen.io/onion2k/full/KRQeqm https://codepen.io/onion2k/full/KRQeqm
- freeopinion 6y agoRight away the red and green hints are wrong. Either that or this puzzle used RegEx rules that contradict those I am familiar with. Either way, they lost my attention.
- ladberg 6y agoThey seem to be accurate under all normal regex rules. Keep in mind that empty values are spaces and a full match is needed!
- freeopinion 6y agoWhat does "full match" mean? Either it matches or it doesn't.
- ladberg 6y agoI think some people may have thought you just have to match any substring within it, so I was clarifying that the whole line has to be a match.
- freeopinion 6y agoSome people would be correct to think that. That is what those regexes mean. If you are secretly prepending a ^ and appending a $, then you are not using the regex displayed.
- danaliv 6y agoSorry, but you're wrong. There's nothing about regular expressions that means you have to use them to search for matching substrings. That's just one particular operation that uses regular expressions. It's not a quality inherent to regular expressions themselves. There are many different operations you can perform with a regular expression besides a substring search. Python, for example, has a fullmatch method.[0] libicu's matches() function returns true "if the pattern matches the entire string, from the start through to the last character."[1] PCRE has various flags that change what it means for a regular expression to match, including PCRE2_ANCHORED and PCRE2_ENDANCHORED. Used together, these options would require a full match with no change to the regular expression itself.[2] 0. https://docs.python.org/3/library/re.html https://docs.python.org/3/library/re.html 1. https://unicode-org.github.io/icu/userguide/strings/regexp.html https://unicode-org.github.io/icu/userguide/strings/regexp.h... 2. http://www.pcre.org/current/doc/html/pcre2api.html#SEC27 http://www.pcre.org/current/doc/html/pcre2api.html#SEC27
- carols10cents 6y agoNY Times Mon < Tue < Wed < Thu < Fri < Sat < Sun < British Cryptic < RegEx
- eludwig 6y agoI would put Sunday between Thursday & Friday, just way more annoying due to grid size
- deleted 6y ago[deleted]
- phonebucket 6y agoI thought I could handle RegEx, but this has given me a legitimate inferiority complex.
- nfoz 6y agoThis was fun :)
- dandanua 6y agoAwesome puzzle! Can be completed without guesses. Any ideas how it was invented?
- schoen 6y agoLook at the original MIT Mystery Hunt page (and solution). It was part of a puzzle hunt. (I was one of the people who successfully solved it on my team during that very event back in 2013...) See this comment for the link to the original, including the author's name and the puzzle in context with its official solution: https://news.ycombinator.com/item?id=26439598 https://news.ycombinator.com/item?id=26439598 (I wish that other comment would get upvoted to the top -- this was written by an identifiable person for a specific identifiable puzzle event, so it's not like mysterious anonymous Internet folklore or something.)
- frob 6y agoHah! I was beginning to suspect there existed some pattern or answer in the result and was looking for an answer. The better part of 2 decades of mystery hunt has conditioned me. I see a four-letter snack in there that jumps out as a possible solution. Should we call hq?
- schoen 6y agoI'm afraid HQ closed around 8 years and 56 days ago. :-)
- chaorace 6y agoIt took me just under 2.5 hours. How are you folks faring? Tip: Ctrl-Z is your friend ;)
- zermelo 6y agoYep, 1h5 hours for me!
- SCLeo 6y agoIt took me 1 hour 30 minutes. Have to say, this is so well designed. Love it.
- cammil 6y agoabout the same for me too.
- jl6 6y agoBrilliant. I wonder how it was made? I solved this in about 1.5 hours by starting at the top left, entering any string that satisfied at least one condition, then moving on to the next condition and “fixing up” any previous entries. I was fearful that I might arrive at a nearly correct solution that I would have to massively backtrack from, but it didn’t happen - I only needed a few short backtracks. I think the large number of constraints helps a lot.
- schoen 6y agoSee this comment https://news.ycombinator.com/item?id=26439598 https://news.ycombinator.com/item?id=26439598 for proper credit to the original author (and place of publication).
- mypalmike 6y agoSpent a similar amount of time... Ended up with a "solution" that breaks 1 constraint. Must have erred somewhere, but backtracking is only leading to other 1-broken constraint outcomes. Sigh.
- schoen 6y agoOfficial solution from the original author: https://web.mit.edu/puzzle/www/2013/coinheist.com/rubik/a_regular_crossword/answer/index.html https://web.mit.edu/puzzle/www/2013/coinheist.com/rubik/a_re...
- lkbm 6y agoOooh, I was stuck because I was insisting on `.(1)(2)(3)(4)\4\3\2\1.` having the middle eight characters mirror each other, which results in a clear contradiction with a few of the crosses. Thanks for posting the answers. I think I'm done working on it for now, but that one was really bothering me.
- darkerside 6y agoThis is how I interpret it, too. What am I missing?
- torgard 6y agoWhat a game! Thanks for this. It took me close to three hours to solve this, hahaha
- stevage 6y agoIs there something wrong? Why isn't the clue `(O|RHH|MM)*` satisfied by blankness?
- ufo 6y agoYou can assume that all regexes are "anchored". They match the entire word, not just a substring.
- beaconstudios 6y agonice, solved it in about half an hour. At first it looked impossible past the first maybe 5 free characters. I feel like there were a lot of characters that had to be solved sudoku-style by holding up to 4 constraints in mind at the same time, which was tricky.
- Jimbly 6y agoHuh, well, this explains why my 8-year old repo is suddenly getting a bunch of comments and PRs...
- de_nied 6y agoRecycling isn't limited to plastics.
- de6u99er 6y agoGreat idea. Love it!
- andrelaszlo 6y agoI was so happy when I found it again! I was looking through my pictures folder and found this thing that I made the first time I saw your implementation https://helvetet.com/_filedump/crossword.gif https://helvetet.com/_filedump/crossword.gif The ones on https://regexcrossword.com/ https://regexcrossword.com/ are nice but this is the original, for me at least!
- acdw 6y agoI thought this would be a true crossword -- i.e., it'd have /words/ to solve for ... :/ Really neat puzzle though!
- Jimbly 6y agoIn the context of the original MIT Puzzle Hunt, there is a single word or phrase that comes out of solving the entire thing, but, yeah, would be interesting if it were all words!
- kubanczyk 6y agoHaving the words everywhere would take away some fun, because the solution space would become severely constrained. Like with those DI|NS|OM expressions or that (...?)* line.
- brianpan 6y agoOMG, I was having the hardest time figuring out what 3 regexes applied to each hex. Then I reloaded partway through and the HIGHLIGHTING started working. Reload if you don't see the regexes turn bold when you click in a hex!
- gfaure 6y agoSolved it! I kept tilting my head because it was hard to see the clue and interpret it at the same time. The ability to highlight all three diagonals would have been perfect. The final clue I had to complete was that tricky .*(.)(.)(.)(.)\4\3\2\1.*
- ilikepi 6y ago> I kept tilting my head because it was hard to see the clue and interpret it at the same time. Agreed, I definitely found myself doing that. > The final clue I had to complete was that tricky .(.)(.)(.)(.)\4\3\2\1. Interesting...I think I had the main guts of that one worked out when I was about 1/3 of the way through, but admittedly I did take a screenshot and mark it up in order to keep track of the various possibilities. It was (...?)\1* that tripped me up because I had an overly broad interpretation of its mechanics. I wonder if it would be possible to record a bunch of 0-100% runs and then to make some sort of visualization to demonstrate different approaches...
- ziml77 6y agoI think that was between 1 and 1.5 hours to solve. Was a fun puzzle! Though for some reason my brain was expecting the NYT Crossword completion music when I filled that last hexagon...
- aasasd 6y agoThis confirms my long-standing annoyance with regexes: the dot is poorly visible among other characters and jumps out at me when I'm already thinking of a match.
- amelius 6y agoI think it would be more satisfying if the result was some human-readable text rather than a random selection of characters. Otherwise, interesting concept!
- siraben 6y agoWhat would writing a solver for regex crosswords entail? Is it just a matter of constraint solving, and what would the running time be?
- kjrose 6y agoThis was awesome. I loved it so much. Personally I'd even pay good money for a series of these style of puzzles.
- Algol 6y agoThat was a lot of fun. It can help solving this puzzle if you are familiar with techniques for solving picross (AKA nonogram) puzzles.
- adrianmonk 6y agoThanks! I did some nonograms years ago, and I saw the similarity but couldn't remember the name of that type of puzzle. I think I saw at least 3 places where that technique could be used, probably more.