{"id":10023,"date":"2023-03-11T14:07:02","date_gmt":"2023-03-11T19:07:02","guid":{"rendered":"https:\/\/blogs.mathworks.com\/cleve\/?p=10023"},"modified":"2023-03-24T14:02:25","modified_gmt":"2023-03-24T18:02:25","slug":"wordbot-and-words-my-wordle-assistants","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/cleve\/2023\/03\/11\/wordbot-and-words-my-wordle-assistants\/","title":{"rendered":"WordBot and Words, My Wordle Assistants"},"content":{"rendered":"<div class=\"content\"><!--introduction--><p>I am late joining the Wordle craze. Over a year ago, MATLAB programs for solving Wordle puzzles were described by <a href=\"https:\/\/blogs.mathworks.com\/loren\/2022\/01\/18\/building-a-wordle-solver\/\">Adam Filion<\/a> as a guest blogger on Loren's blog and by <a href=\"https:\/\/www.youtube.com\/watch?v=bVTcQtEnOlk\">Matt Tearle<\/a> with a YouTube video. But my programs for Wordle Assistants are different. <tt>WordBot<\/tt> doesn't try to solve any puzzles and <tt>Words<\/tt> just supplies lists of possible words. I enjoy providing the solution logic myself.<\/p><p>Here are two examples, taken from recent Wordle puzzles in the <a href=\"https:\/\/www.nytimes.com\/games\/wordle\/index.html\"><i>New York Times<\/i><\/a>.<\/p><!--\/introduction--><h3>Contents<\/h3><div><ul><li><a href=\"#b7ce77aa-973f-4d84-b984-ec0f9c752555\">Wednesday<\/a><\/li><li><a href=\"#145f5714-dcd6-46f5-b419-4acac006e6e4\">Thursday<\/a><\/li><li><a href=\"#67cd6081-5259-44ab-a69c-3499d526170f\">A Week in March<\/a><\/li><li><a href=\"#9ce2d251-88f0-4a09-8b1e-65f3d8452464\">Software<\/a><\/li><\/ul><\/div><h4>Wednesday<a name=\"b7ce77aa-973f-4d84-b984-ec0f9c752555\"><\/a><\/h4><p><tt>WordBot<\/tt> has a list of 4676 possible words, but knows nothing about their probabilities, so I don't ask for any assistance with the opening guess.<\/p><p>I like to use mathematical words whenever possible. I usually start with <tt>RATIO<\/tt>, which has three vowels and two popular consonants. <tt>RATIO<\/tt> was a good opening move for the puzzle in the <i>Times<\/i> on Wednesday. It received a green <tt>R<\/tt> and a gold <tt>A<\/tt>. I informed <tt>WordBot<\/tt> of our good fortune using 2, 1 and 0 to indicate green, gold and gray. My faithful assistant responded by reproducing the first graphic in the  <i>Times<\/i>.<\/p><pre class=\"codeinput\">    WordBot <span class=\"string\">ratio<\/span> <span class=\"string\">21000<\/span>\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/WordBot_blog_01.png\" alt=\"\"> <p><tt>Words<\/tt> is my suite of programs that produce lists of acceptable words for various scenarios.  In this situation with an <tt>R<\/tt> as the first letter, an <tt>A<\/tt> somewhere in the last three letters and <tt>T<\/tt>, <tt>I<\/tt> and <tt>O<\/tt> on the gray list, <tt>Words<\/tt> finds 25 words, starting with <tt>REACH<\/tt> and ending with <tt>RUMBA<\/tt>.<\/p><p>The last of those 25 words got my attention.  I decided to try <tt>RUMBA<\/tt> on my second move. I knew <tt>RUMBA<\/tt> was unlikely to succeed but would be spectacular if it did.  Sure enough, Wordle didn't want to dance.<\/p><pre class=\"codeinput\">    WordBot <span class=\"string\">rumba<\/span> <span class=\"string\">20001<\/span>\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/WordBot_blog_02.png\" alt=\"\"> <p>Three more letters gray-listed and <tt>A<\/tt> limited to two slots reduces the number of possible words from 25 to 18. The first word on the list is still <tt>REACH<\/tt>.<\/p><pre class=\"codeinput\">    WordBot <span class=\"string\">reach<\/span> <span class=\"string\">22100<\/span>\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/WordBot_blog_03.png\" alt=\"\"> <p>There are now 11 possibilities.<\/p><pre class=\"language-matlab\">READS\r\nREADY\r\nREALS\r\nREAPS\r\nREARS\r\nREGAL\r\nRELAX\r\nRELAY\r\nRENAL\r\nREPAY\r\nRERAN\r\n<\/pre><p>I need to relax.<\/p><pre class=\"codeinput\">    WordBot <span class=\"string\">relax<\/span> <span class=\"string\">22120<\/span>\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/WordBot_blog_04.png\" alt=\"\"> <p>I don't need another list of possibilities. I can quickly see the previous list has only two words that end in <tt>L<\/tt>.  The  choice between \"fit for a monarch\" and \"pertaining to kidney function\" is clear. I have solved Wednesday's puzzle in five moves, including the Hail Mary at move two.<\/p><pre class=\"codeinput\">    WordBot <span class=\"string\">regal<\/span> <span class=\"string\">22222<\/span>\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/WordBot_blog_05.png\" alt=\"\"> <pre class=\"codeinput\">    close\r\n<\/pre><h4>Thursday<a name=\"145f5714-dcd6-46f5-b419-4acac006e6e4\"><\/a><\/h4><p>Thursday's puzzle in the <i>Times<\/i> offered different challenges. As always, I started with <tt>RATIO<\/tt>.  This time I get only one gold letter.<\/p><pre class=\"codeinput\">    WordBot <span class=\"string\">ratio<\/span> <span class=\"string\">10000<\/span>\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/WordBot_blog_06.png\" alt=\"\"> <p>I need an <tt>R<\/tt> somewhere in the last four positions and can't use <tt>A<\/tt>, <tt>T<\/tt>, <tt>I<\/tt> or <tt>O<\/tt>. <tt>Words<\/tt> knows 229 qualified candidates. I choose another mathematical word.<\/p><pre class=\"codeinput\">    WordBot <span class=\"string\">perms<\/span> <span class=\"string\">01100<\/span>\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/WordBot_blog_07.png\" alt=\"\"> <p>I now must have an <tt>R<\/tt> and an <tt>E<\/tt> and can't have any of those seven grays. <tt>Words<\/tt> offers 72 possibilities.  Have I been in an accident?<\/p><pre class=\"codeinput\">    WordBot <span class=\"string\">wreck<\/span> <span class=\"string\">21200<\/span>\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/WordBot_blog_08.png\" alt=\"\"> <p>Well, that's much better.  Two greens, one gold, and nine grays. There is only one possibility.   The solution must be <tt>WHERE<\/tt>.<\/p><pre class=\"codeinput\">    WordBot <span class=\"string\">where<\/span> <span class=\"string\">22222<\/span>\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/WordBot_blog_09.png\" alt=\"\"> <pre class=\"codeinput\">    close\r\n<\/pre><h4>A Week in March<a name=\"67cd6081-5259-44ab-a69c-3499d526170f\"><\/a><\/h4><p>Wednesday through Tuesday<\/p><p>If your browser isn't showing the animation, <a href=\"https:\/\/blogs.mathworks.com\/cleve\/files\/word_gif37.gif\">look here<\/a>.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"http:\/\/blogs.mathworks.com\/cleve\/files\/word_gif37.gif\" alt=\"\"> <\/p><h4>Software<a name=\"9ce2d251-88f0-4a09-8b1e-65f3d8452464\"><\/a><\/h4><p><a href=\"https:\/\/blogs.mathworks.com\/cleve\/files\/WordBot_2_mzip.m\">This code<\/a> is immature.  Be gentle and let me know how it works for you.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_9051280cc6df412fa3620070391ad57f() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='9051280cc6df412fa3620070391ad57f ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 9051280cc6df412fa3620070391ad57f';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2023 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_9051280cc6df412fa3620070391ad57f()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2023a<br><\/p><\/div><!--\r\n9051280cc6df412fa3620070391ad57f ##### SOURCE BEGIN #####\r\n%% WordBot and Words, My Wordle Assistants\r\n% I am late joining the Wordle craze.\r\n% Over a year ago, MATLAB programs for solving Wordle puzzles \r\n% were described by\r\n% <https:\/\/blogs.mathworks.com\/loren\/2022\/01\/18\/building-a-wordle-solver\/\r\n% Adam Filion> as a guest blogger on Loren's blog and by\r\n% <https:\/\/www.youtube.com\/watch?v=bVTcQtEnOlk\r\n% Matt Tearle> with a YouTube video.\r\n% But my programs for Wordle Assistants are different.\r\n% |WordBot| doesn't try to solve any puzzles and\r\n% |Words| just supplies lists of possible words.\r\n% I enjoy providing the solution logic myself. \r\n%\r\n% Here are two examples, taken from recent Wordle puzzles in the\r\n% <https:\/\/www.nytimes.com\/games\/wordle\/index.html\r\n% _New York Times_>.\r\n\r\n\r\n%% Wednesday\r\n% |WordBot| has a list of 4676 possible words,\r\n% but knows nothing about their probabilities, so I don't ask\r\n% for any assistance with the opening guess.\r\n%\r\n% I like to use mathematical words whenever possible.\r\n% I usually start with |RATIO|, which has three vowels and two\r\n% popular consonants. |RATIO| was a good opening move\r\n% for the puzzle in the _Times_ on Wednesday.\r\n% It received a green |R| and a gold |A|.\r\n% I informed |WordBot| of our good fortune using\r\n% 2, 1 and 0 to indicate green, gold and gray.\r\n% My faithful assistant responded by reproducing the first \r\n% graphic in the  _Times_.\r\n\r\n    WordBot ratio 21000\r\n\r\n\r\n%%\r\n% |Words| is my suite of programs that produce lists of\r\n% acceptable words for various scenarios.  In this situation\r\n% with an |R| as the first letter, an |A| somewhere in the last\r\n% three letters and |T|, |I| and |O| on the gray list, |Words|  \r\n% finds 25 words, starting with |REACH| and ending with |RUMBA|.\r\n% \r\n% The last of those 25 words got my attention.  I decided to try |RUMBA|\r\n% on my second move.\r\n% I knew |RUMBA| was unlikely to succeed but would be\r\n% spectacular if it did.  Sure enough, Wordle didn't want to dance.\r\n\r\n    WordBot rumba 20001\r\n\r\n%%\r\n% Three more letters gray-listed and |A| limited to two slots reduces the\r\n% number of possible words from 25 to 18.\r\n% The first word on the list is still |REACH|.\r\n\r\n    WordBot reach 22100\r\n\r\n%%\r\n% There are now 11 possibilities.\r\n% \r\n%   READS\r\n%   READY\r\n%   REALS\r\n%   REAPS\r\n%   REARS\r\n%   REGAL\r\n%   RELAX\r\n%   RELAY\r\n%   RENAL\r\n%   REPAY\r\n%   RERAN\r\n%\r\n% I need to relax.\r\n% \r\n    WordBot relax 22120\r\n\r\n%%\r\n% I don't need another list of possibilities.\r\n% I can quickly see the previous list has only two words that\r\n% end in |L|.  The  choice between \"fit for a monarch\" and\r\n% \"pertaining to kidney function\" is clear.\r\n% I have solved Wednesday's puzzle in five moves, including the Hail Mary\r\n% at move two.\r\n\r\n    WordBot regal 22222\r\n\r\n%%\r\n    close\r\n\r\n%% Thursday\r\n% Thursday's puzzle in the _Times_ offered different challenges.\r\n% As always, I started with |RATIO|.  This time I get only one\r\n% gold letter.\r\n\r\n    WordBot ratio 10000\r\n\r\n%%\r\n% I need an |R| somewhere in the last four positions and can't\r\n% use |A|, |T|, |I| or |O|. |Words| knows 229 qualified candidates.\r\n% I choose another mathematical word.\r\n\r\n    WordBot perms 01100\r\n\r\n%%\r\n% I now must have an |R| and an |E| and can't have any of those seven\r\n% grays. |Words| offers 72 possibilities.  Have I been in an accident?\r\n\r\n    WordBot wreck 21200\r\n\r\n%% \r\n% Well, that's much better.  Two greens, one gold, and nine grays.\r\n% There is only one possibility.   The solution must be |WHERE|.\r\n\r\n    WordBot where 22222\r\n\r\n%% \r\n    close\r\n\r\n%% A Week in March\r\n% Wednesday through Tuesday\r\n%\r\n% If your browser isn't showing the animation,\r\n% <https:\/\/blogs.mathworks.com\/cleve\/files\/word_gifxx.gif\r\n% look here>.\r\n%\r\n% <<word_gifxx.gif>>\r\n%\r\n\r\n%% Software\r\n% <https:\/\/blogs.mathworks.com\/cleve\/files\/WordBot_2_mzip.m\r\n% This code> is immature.  Be gentle and let me know how it \r\n% works for you.\r\n\r\n##### SOURCE END ##### 9051280cc6df412fa3620070391ad57f\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/cleve\/files\/word_gif37.gif\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div><!--introduction--><p>I am late joining the Wordle craze. Over a year ago, MATLAB programs for solving Wordle puzzles were described by <a href=\"https:\/\/blogs.mathworks.com\/loren\/2022\/01\/18\/building-a-wordle-solver\/\">Adam Filion<\/a> as a guest blogger on Loren's blog and by <a href=\"https:\/\/www.youtube.com\/watch?v=bVTcQtEnOlk\">Matt Tearle<\/a> with a YouTube video. But my programs for Wordle Assistants are different. <tt>WordBot<\/tt> doesn't try to solve any puzzles and <tt>Words<\/tt> just supplies lists of possible words. I enjoy providing the solution logic myself.... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/cleve\/2023\/03\/11\/wordbot-and-words-my-wordle-assistants\/\">read more >><\/a><\/p>","protected":false},"author":78,"featured_media":10152,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,23,47,31],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/10023"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/users\/78"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/comments?post=10023"}],"version-history":[{"count":21,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/10023\/revisions"}],"predecessor-version":[{"id":10149,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/10023\/revisions\/10149"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/media\/10152"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/media?parent=10023"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/categories?post=10023"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/tags?post=10023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}