{"id":2029,"date":"2011-03-10T22:29:23","date_gmt":"2011-03-11T02:29:23","guid":{"rendered":"http:\/\/johncohn.org\/base\/?p=2029"},"modified":"2011-03-10T22:29:23","modified_gmt":"2011-03-11T02:29:23","slug":"thursday-night-puzzled","status":"publish","type":"post","link":"http:\/\/johncohn.org\/base\/2011\/03\/10\/thursday-night-puzzled\/","title":{"rendered":"Thursday night &#8211; puzzled"},"content":{"rendered":"<blockquote><p>Not much to report today.. so I&#8217;llreach back to last weekend for something that happened then.. On my birthday in February, Diane got me this\u00a0 puzzle.. I love puzzles.. but this one is\u00a0 really diabolical.. With only 9 pieces it has over 300,000 possible answers.. and only 1 is right.. well.. actually there are four correct answers.. but I&#8217;m getting ahead of myself<\/p>\n<p>Everybody in the house took terms beating their head against this puzzle for several days.. but.. no luck&#8230;<\/p>\n<p><a href=\"..\/wp-content\/uploads\/2011\/03\/mar0611-011.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"mar0611 011\" src=\"..\/wp-content\/uploads\/2011\/03\/mar0611-011.jpg\" alt=\"\" width=\"600\" height=\"450\" \/><\/a><\/p>\n<p><a href=\"http:\/\/johncohn.org\/base\/wp-content\/uploads\/2011\/03\/mar0611-010.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2032\" title=\"mar0611 010\" src=\"http:\/\/johncohn.org\/base\/wp-content\/uploads\/2011\/03\/mar0611-010.jpg\" alt=\"\" width=\"600\" height=\"450\" srcset=\"http:\/\/johncohn.org\/base\/wp-content\/uploads\/2011\/03\/mar0611-010.jpg 600w, http:\/\/johncohn.org\/base\/wp-content\/uploads\/2011\/03\/mar0611-010.jpg 300w, http:\/\/johncohn.org\/base\/wp-content\/uploads\/2011\/03\/mar0611-010.jpg 266w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/a><\/p>\n<p>Finally in a huge fit of procrastination &#8230; (i had tons of work, work to do).. I wrote the following.. actually.. I wrote this in my head when I should have been listening to a feldenkreis class..<\/p>\n<p>it went something like this (in badly formed Python)<\/p>\n<pre><span style=\"color: #3366ff;\"># solve that @#%@ing puzzle\r\npieces = [\u00a0\u00a0 [-4,4,1,-1],\u00a0\u00a0 [-2,-3,1,3],\u00a0\u00a0 [-3,3,4,-4],\u00a0\u00a0 [-1,-1,3,4],\r\n\u00a0\u00a0 [-1,1,3,-4],\u00a0\u00a0 [-3,-4,2,4],\u00a0\u00a0 [-3,2,4,-2],\u00a0\u00a0 [-3,-1,2,2],\u00a0\u00a0 [-1,3,2,-2]]\r\n\r\nplaced = [-1,-1,-1,-1,-1,-1,-1,-1,-1]\r\nr = [0,0,0,0,0,0,0,0,0]\r\nmd = 0\r\ntrys=0\r\n\r\ndef showplace():\r\n\u00a0\u00a0 global trys\r\n\u00a0\u00a0 for i in range(len(placed)):\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 if placed[i] &gt; -1:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 print '\u00a0 %2i\u00a0\u00a0 ' % pieces[placed[i]][(r[i]+1)%4],\r\n\u00a0\u00a0 print \"\"\r\n\u00a0\u00a0 for i in range(len(placed)):\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 if placed[i] &gt; -1:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 print '%2i\u00a0 %2i ' % (pieces[placed[i]][(r[i]+0)%4],pieces[placed[i]][(r[i]+2)%4]),\r\n\u00a0\u00a0 print \"\"\r\n\u00a0\u00a0 for i in range(len(placed)):\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 if placed[i] &gt; -1:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 print '\u00a0 %2i\u00a0\u00a0 ' % pieces[placed[i]][(r[i]+3)%4],\r\n\u00a0\u00a0 print \"\"\r\n\u00a0\u00a0 print \"trys=\", trys\r\n\u00a0\u00a0 print \"\"\r\n\u00a0\u00a0 \r\ndef place( unplaced, depth, spaces):\r\n\u00a0\u00a0 global md\r\n\u00a0\u00a0 global trys\r\n\u00a0\u00a0 trys = trys + 1\r\n\u00a0\u00a0 if depth &gt; md :\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 md = depth\r\n\u00a0\u00a0 for i in range(len(unplaced)) :\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 runplaced = unplaced[:]\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 p = runplaced.pop(i)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 placed[depth] = p\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 for j in range(4) :\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 r[depth] = j\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (depth % 3 ==0) or pieces[placed[depth]][r[depth]]+pieces[placed[depth-1]][(2+r[depth-1]) % 4] == 0:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (depth&lt;3) or pieces[placed[depth]][(r[depth]+1)%4]+pieces[placed[depth-3]][(3+r[depth-3]) % 4] == 0:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if len(runplaced) &gt; 0:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ret=place( runplaced, depth + 1, spaces + \"\u00a0\u00a0 \")\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 else :\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 showplace()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 exit\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 placed[depth] = -1\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 r[depth] = 0\r\n\r\nunplaced = [0,1,2,3,4,5,6,7,8]\r\nplace(unplaced, 0,\u00a0 \" \")<\/span>\r\n<\/pre>\n<p>5 seconds later I\u00a0 had the solution<\/p>\n<pre>\u00a0\u00a0 3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0   4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0  2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0  1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0  3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0  4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0  2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0  4\u00a0\u00a0\u00a0 \r\n-1\u00a0\u00a0 4\u00a0 -4\u00a0\u00a0 1\u00a0 -1\u00a0\u00a0 2\u00a0 -1\u00a0\u00a0 3\u00a0 -3\u00a0\u00a0 3\u00a0 -3\u00a0\u00a0 4\u00a0\u00a0 2\u00a0 -3\u00a0\u00a0 3\u00a0 -2\u00a0\u00a0 2\u00a0 -2\u00a0 \r\n\u00a0 -1\u00a0\u00a0\u00a0\u00a0\u00a0  -1\u00a0\u00a0\u00a0\u00a0\u00a0  -3\u00a0\u00a0\u00a0\u00a0\u00a0  -4\u00a0\u00a0\u00a0\u00a0\u00a0  -2\u00a0\u00a0\u00a0\u00a0\u00a0  -4\u00a0\u00a0\u00a0\u00a0\u00a0  -4\u00a0\u00a0\u00a0\u00a0\u00a0  -1\u00a0\u00a0\u00a0\u00a0\u00a0 -3\u00a0\u00a0\u00a0 \r\ntrys= 1048\r\n\r\n\u00a0\u00a0 2\u00a0\u00a0\u00a0\u00a0\u00a0   -1\u00a0\u00a0\u00a0\u00a0\u00a0  -1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0  3\u00a0\u00a0\u00a0\u00a0\u00a0 -3\u00a0\u00a0\u00a0\u00a0\u00a0   -4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2\u00a0\u00a0\u00a0\u00a0 \u00a0 -3\u00a0\u00a0\u00a0\u00a0\u00a0 -1\u00a0\u00a0\u00a0 \r\n-4\u00a0\u00a0 4\u00a0 -4\u00a0\u00a0 1\u00a0 -1\u00a0\u00a0 3\u00a0 -1\u00a0\u00a0 2\u00a0 -2\u00a0\u00a0 1\u00a0 -1\u00a0\u00a0 4\u00a0 -3\u00a0\u00a0 4\u00a0 -4\u00a0\u00a0 3\u00a0 -3\u00a0\u00a0 2\u00a0 \r\n\u00a0 -3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0  3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0   4\u00a0\u00a0\u00a0\u00a0\u00a0  -2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0   1\u00a0\u00a0\u00a0\u00a0\u00a0 -2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0  4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0  2\u00a0\u00a0\u00a0 \r\ntrys= 1732\r\n\r\n\u00a0 -3\u00a0\u00a0\u00a0\u00a0\u00a0   -1\u00a0\u00a0\u00a0\u00a0\u00a0 -4\u00a0\u00a0\u00a0\u00a0\u00a0  -4\u00a0\u00a0\u00a0\u00a0\u00a0  -2\u00a0\u00a0\u00a0\u00a0\u00a0  -4\u00a0\u00a0\u00a0\u00a0\u00a0 -3\u00a0\u00a0\u00a0\u00a0\u00a0   -1\u00a0\u00a0\u00a0\u00a0\u00a0 -1\u00a0\u00a0\u00a0 \r\n-2\u00a0\u00a0 2\u00a0 -2\u00a0\u00a0 3\u00a0 -3\u00a0\u00a0 2\u00a0\u00a0 4\u00a0 -3\u00a0\u00a0 3\u00a0 -3\u00a0\u00a0 3\u00a0 -1\u00a0\u00a0 2\u00a0 -1\u00a0\u00a0 1\u00a0 -4\u00a0\u00a0 4\u00a0 -1\u00a0 \r\n\u00a0\u00a0 4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0   2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0  3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0   1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0  1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0   4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3\u00a0\u00a0\u00a0 \r\ntrys= 2289\r\n\r\n\u00a0\u00a0 2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0   4\u00a0\u00a0\u00a0\u00a0\u00a0  -2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0  1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0  3\u00a0\u00a0\u00a0\u00a0\u00a0  -2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0  3\u00a0\u00a0\u00a0\u00a0\u00a0   -3\u00a0\u00a0\u00a0 \r\n\u00a02\u00a0 -3\u00a0\u00a0 3\u00a0 -4\u00a0\u00a0 4\u00a0 -3\u00a0\u00a0 4\u00a0 -1\u00a0\u00a0 1\u00a0 -2\u00a0\u00a0 2\u00a0 -1\u00a0\u00a0 3\u00a0 -1\u00a0\u00a0 1\u00a0 -4\u00a0\u00a0 4\u00a0 -4\u00a0 \r\n\u00a0 -1\u00a0\u00a0\u00a0\u00a0\u00a0   -3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2\u00a0\u00a0\u00a0\u00a0\u00a0  -4\u00a0\u00a0\u00a0\u00a0\u00a0  -3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0  3\u00a0\u00a0\u00a0\u00a0\u00a0  -1\u00a0\u00a0\u00a0\u00a0\u00a0  -1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2\u00a0\u00a0\u00a0 \r\ntrys= 2458\r\n\r\n<\/pre>\n<p>Actually.. 4 solutions.. since the puzzle can be solved on all 4 directions<\/p>\n<p><a href=\"http:\/\/johncohn.org\/base\/wp-content\/uploads\/2011\/03\/mar0611-007.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2031\" title=\"mar0611 007\" src=\"http:\/\/johncohn.org\/base\/wp-content\/uploads\/2011\/03\/mar0611-007.jpg\" alt=\"\" width=\"600\" height=\"450\" srcset=\"http:\/\/johncohn.org\/base\/wp-content\/uploads\/2011\/03\/mar0611-007.jpg 600w, http:\/\/johncohn.org\/base\/wp-content\/uploads\/2011\/03\/mar0611-007.jpg 300w, http:\/\/johncohn.org\/base\/wp-content\/uploads\/2011\/03\/mar0611-007.jpg 266w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/a><\/p>\n<p>I then tore up the answer so no one else was tempted to cheat..<\/p>\n<p>so.. what do you think.. cool innovation ?.. or unsportsemanlike conduct..<\/p>\n<p>you decide,..<\/p>\n<p>nite all nite sam<\/p>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 1100px; width: 1px; height: 1px; overflow: hidden;\"># solve that @#%@ing puzzle<br \/>\npieces = [\u00a0\u00a0 [-4,4,1,-1],\u00a0\u00a0 [-2,-3,1,3],\u00a0\u00a0 [-3,3,4,-4],\u00a0\u00a0 [-1,-1,3,4],<br \/>\n[-1,1,3,-4],\u00a0\u00a0 [-3,-4,2,4],\u00a0\u00a0 [-3,2,4,-2],\u00a0\u00a0 [-3,-1,2,2],\u00a0\u00a0 [-1,3,2,-2]]<\/p>\n<p>placed = [-1,-1,-1,-1,-1,-1,-1,-1,-1]<br \/>\nr = [0,0,0,0,0,0,0,0,0]<br \/>\nmd = 0<br \/>\ntrys=0<\/p>\n<p>def showplace():<br \/>\nglobal trys<br \/>\nfor i in range(len(placed)):<br \/>\nif placed[i] &gt; -1:<br \/>\nprint &#8216;\u00a0 %2i\u00a0\u00a0 &#8216; % pieces[placed[i]][(r[i]+1)%4],<br \/>\nprint &#8220;&#8221;<br \/>\nfor i in range(len(placed)):<br \/>\nif placed[i] &gt; -1:<br \/>\nprint &#8216;%2i\u00a0 %2i &#8216; % (pieces[placed[i]][(r[i]+0)%4],pieces[placed[i]][(r[i]+2)%4]),<br \/>\nprint &#8220;&#8221;<br \/>\nfor i in range(len(placed)):<br \/>\nif placed[i] &gt; -1:<br \/>\nprint &#8216;\u00a0 %2i\u00a0\u00a0 &#8216; % pieces[placed[i]][(r[i]+3)%4],<br \/>\nprint &#8220;&#8221;<br \/>\nprint &#8220;trys=&#8221;, trys<br \/>\nprint &#8220;&#8221;<\/p>\n<p>def place( unplaced, depth, spaces):<br \/>\nglobal md<br \/>\nglobal trys<br \/>\ntrys = trys + 1<br \/>\nif depth &gt; md :<br \/>\nmd = depth<br \/>\nfor i in range(len(unplaced)) :<br \/>\nrunplaced = unplaced[:]<br \/>\np = runplaced.pop(i)<br \/>\nplaced[depth] = p<\/p>\n<p>for j in range(4) :<br \/>\nr[depth] = j<\/p>\n<p>if (depth % 3 ==0) or pieces[placed[depth]][r[depth]]+pieces[placed[depth-1]][(2+r[depth-1]) % 4] == 0:<br \/>\nif (depth&lt;3) or pieces[placed[depth]][(r[depth]+1)%4]+pieces[placed[depth-3]][(3+r[depth-3]) % 4] == 0:<br \/>\nif len(runplaced) &gt; 0:<br \/>\nret=place( runplaced, depth + 1, spaces + &#8221;\u00a0\u00a0 &#8220;)<br \/>\nelse :<br \/>\nshowplace()<br \/>\nexit<br \/>\nplaced[depth] = -1<br \/>\nr[depth] = 0<\/p>\n<p>unplaced = [0,1,2,3,4,5,6,7,8]<br \/>\nplace(unplaced, 0,\u00a0 &#8221; &#8220;)<\/p>\n<\/div>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Not much to report today.. so I&#8217;llreach back to last weekend for something that happened then.. On my birthday in February, Diane got me this\u00a0 puzzle.. I love puzzles.. but this one is\u00a0 really diabolical.. With only 9 pieces it has over 300,000 possible answers.. and only 1 is right.. well.. actually there are four &hellip; <a href=\"http:\/\/johncohn.org\/base\/2011\/03\/10\/thursday-night-puzzled\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Thursday night &#8211; puzzled<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[1],"tags":[93],"class_list":["post-2029","post","type-post","status-publish","format-standard","hentry","tag-puzzled"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/posts\/2029","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/comments?post=2029"}],"version-history":[{"count":2,"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/posts\/2029\/revisions"}],"predecessor-version":[{"id":2034,"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/posts\/2029\/revisions\/2034"}],"wp:attachment":[{"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/media?parent=2029"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/categories?post=2029"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/johncohn.org\/base\/wp-json\/wp\/v2\/tags?post=2029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}