Skip to content

Latest commit

 

History

History
35 lines (22 loc) · 1.44 KB

README.md

File metadata and controls

35 lines (22 loc) · 1.44 KB

regex-crossword

This is a C# program to solve a "regular expression crossword" by constraint propagation.

It includes a regular expression library which can enumerate possible matches to a regex given a constraint string. To save processing time, the possible matches are returned as a character set string (a minimal regex, in effect) rather than a list of strings directly:

var regex = new Regex("X*YX*");
var str = CharSetString.UnconstrainedStringOfLength(7);
Assert.IsTrue(regex.AddConstraints(str));
Assert.AreEqual("[XY][XY][XY][XY][XY][XY][XY]", str.ToString());

str = CharSetString.Parse("..Y....");
Assert.IsTrue(regex.AddConstraints(str));
Assert.AreEqual("XXYXXXX", str.ToString());

MIT Mystery Hunt 2013

This was inspired by the hexagonal regular expression crossword from the MIT Mystery Hunt 2013.

Watch this program solve the puzzle here.

The MIT Mystery Hunt 2013 web pages are at:

People blogged about this crossword at: