{"id":212,"date":"2011-04-24T01:59:42","date_gmt":"2011-04-24T05:59:42","guid":{"rendered":"http:\/\/adamrosenfield.com\/blog\/?p=212"},"modified":"2013-01-01T19:02:14","modified_gmt":"2013-01-01T23:02:14","slug":"algebraic-crosswords","status":"publish","type":"post","link":"http:\/\/adamrosenfield.com\/blog\/2011\/04\/24\/algebraic-crosswords\/","title":{"rendered":"Algebraic Crosswords"},"content":{"rendered":"<p>A blogger by the name of T Campbell recently posted <a href=\"http:\/\/www.crosswordfiend.com\/blog\/2011\/04\/23\/algebraic-crosswords-cts-10\/\">an interesting read about Algebraic Crosswords<\/a>.  And at the end, T posts a $100 bounty for a computer program to help crossword constructors construct such crosswords.  That&#8217;s right up my alley as both a programmer and a puzzle solver, so I threw together a quick Python script to do the job.<\/p>\n<p>My program, named algxword, can be downloaded from <a href=\"https:\/\/github.com\/adamantoise\/puzzle-tools\/tree\/master\/algxword\">my GitHub<\/a>.<\/p>\n<p>The usage is as follows:<\/p>\n<pre>Usage: .\/algxword.py [OPTIONS...] WORDLIST FROM TO\r\n\r\nFinds all words in the file WORDLIST (which need not be sorted) which would\r\ncontinue to be words when substituting the substring FROM for the substring TO.\r\nOnly words which contain FROM in them are considered.\r\n\r\nBoth FROM and TO can be empty strings.  If FROM is the empty string, then TO is\r\nadded at each position in the string to test for a word.  If TO is the empty\r\nstring, then the FROM string is simply deleted.\r\n\r\nOrdinarily, only the first occurrence of FROM is replaced with TO.  If the -a\r\noption is specified, then all occurrences of FROM are replaced with TO.\r\n\r\nOPTIONS:\r\n\r\n-a      Replaces all occurrences of FROM with TO when testing for a word\r\n--help  Prints this help message<\/pre>\n<p>Examples:<\/p>\n<pre># Find all words which remain words when substituting the first occurrence of\r\n# 'qu' for 'k' in the word list \/usr\/share\/dict\/words\r\npython algxword.py \/usr\/share\/dict\/words qu k\r\n\r\n# Same as above, but replace all occurrences of 'qu' for 'k'\r\npython algxword.py -a \/usr\/share\/dict\/words qu k\r\n\r\n# Find all words which can have an 'lax' inserted in them\r\npython algxword.py \/usr\/share\/dict\/words \"\" lax<\/pre>\n<p>More detailed instructions for the less command line-savvy can be found in the included README file.<\/p>\n<p><b>UPDATE 2013-01-01:<\/b><\/p>\n<p>The download location has been moved to GitHub.  I also relicensed it under a BSD-like license instead of the GNU GPL.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A blogger by the name of T Campbell recently posted an interesting read about Algebraic Crosswords. And at the end, T posts a $100 bounty for a computer program to help crossword constructors construct such crosswords. That&#8217;s right up my alley as both a programmer and a puzzle solver, so I threw together a quick [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,35],"tags":[],"class_list":["post-212","post","type-post","status-publish","format-standard","hentry","category-programming","category-puzzles"],"_links":{"self":[{"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/posts\/212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/comments?post=212"}],"version-history":[{"count":8,"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/posts\/212\/revisions"}],"predecessor-version":[{"id":320,"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/posts\/212\/revisions\/320"}],"wp:attachment":[{"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/media?parent=212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/categories?post=212"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/adamrosenfield.com\/blog\/wp-json\/wp\/v2\/tags?post=212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}