{"id":29039,"date":"2020-05-25T15:16:12","date_gmt":"2020-05-25T19:16:12","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=29039"},"modified":"2020-05-25T15:16:12","modified_gmt":"2020-05-25T19:16:12","slug":"solving-the-miracle-sudoku-in-prolog","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2020\/05\/25\/solving-the-miracle-sudoku-in-prolog\/","title":{"rendered":"Solving the &ldquo;Miracle Sudoku&rdquo; in Prolog"},"content":{"rendered":"<p><a href=\"https:\/\/kottke.org\/20\/05\/solving-the-the-miracle-sudoku\">Jason Kottke<\/a>:<\/p>\n<blockquote cite=\"https:\/\/kottke.org\/20\/05\/solving-the-the-miracle-sudoku\">\n<p>The solver himself calls it &ldquo;a work of sublime genius&rdquo; and &ldquo;one of the most extraordinary puzzles we&rsquo;ve ever seen&rdquo;. It&rsquo;s fascinating listening to him slowly uncover different aspects of the puzzle &mdash; watching him methodically figure out the 3s was genuinely thrilling.<\/p>\n<\/blockquote>\n\n<p><a href=\"https:\/\/benjamincongdon.me\/blog\/2020\/05\/23\/Solving-the-Miracle-Sudoku-in-Prolog\/\">Ben Congdon<\/a> (via <a href=\"https:\/\/news.ycombinator.com\/item?id=23302102\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"https:\/\/benjamincongdon.me\/blog\/2020\/05\/23\/Solving-the-Miracle-Sudoku-in-Prolog\/\"><p>Since Prolog is a declarative language, writing a Sudoku solver is remarkably concise. In essence, all the programmer needs to do is define the constraints of the game, and Prolog is smart enough to find solutions[&#8230;]<\/p>\n<p>[&#8230;]<\/p>\n<p>The cool thing about this code is that it works both as a Sudoku <em>solver<\/em> and as\na Sudoku <em>generator<\/em>. You can query it with a partially solved board, and it\nwill find all valid solutions.<\/p>\n<p>[&#8230;]<\/p>\n<p>Surprisingly, there are only 72 solution boards that meet the Miracle Sudoku constraints.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Jason Kottke: The solver himself calls it &ldquo;a work of sublime genius&rdquo; and &ldquo;one of the most extraordinary puzzles we&rsquo;ve ever seen&rdquo;. It&rsquo;s fascinating listening to him slowly uncover different aspects of the puzzle &mdash; watching him methodically figure out the 3s was genuinely thrilling. Ben Congdon (via Hacker News): Since Prolog is a declarative [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2020-05-25T19:16:16Z","apple_news_api_id":"a97467d1-f356-4637-907d-61530557b5b9","apple_news_api_modified_at":"2020-05-25T19:16:16Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/AqXRn0fNWRjeQfWFTBVe1uQ","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[418,71,1948],"class_list":["post-29039","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-game","tag-programming","tag-prolog"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/29039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=29039"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/29039\/revisions"}],"predecessor-version":[{"id":29040,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/29039\/revisions\/29040"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=29039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=29039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=29039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}