Fork me on GitHub

RegHex

I highly enjoyed the hexagonal regular expression puzzle ("A Regular Crossword" by Dan Gulotta based on an idea by Palmer Mebane) from this year's MIT puzzle hunt. I found it awkward to solve on a computer though, it needed a better interface.

So I made one.

Use the ⇐ and ⇒ buttons to rotate the puzzle widdershins or clockwise, respectively (or just hover over the puzzle and use your normal left and right keys).

Click a hexagon and type a letter A-Z (capitalization not important) to fill it with a guess. Hit backspace to clear a guess, and tab to move to the next hexagon in the row.

When an entire row is filled, it will be colored green if the row matches the clue, and red if it doesn't. I'd like to provide some earlier feedback, but to do so correctly would require a good algorithm to determine if the intersection of a regular expression and a string of guesses and blanks have a non-empty intersection. I'm on the lookout for one, so let me know if you find one.

Of course, there's no reason this has to be the only puzzle of this type.

The original puzzle is specified in json, and loaded dynamically by the page.

Now that I've got the software down (well, mostly, it's not like I'm not going to continue tweaking), I'm going to work on creating some more, but I'll gladly take contributions.

Each cell in the hex grid has a unique address, based on three (non-orthogonal) axes:

As you can see from the grid on the left, each hex is two units wide in each of the three directions. Since the axes aren't orthogonal, moving along one axis changes your offset along the others. Moving one hex in any direction will increment one coordinate by two, and decrement the other two by one (or decrement one by two, and increment two by one).

Enjoy! - Noah (rampion)