{"id":54949,"date":"2022-02-20T03:01:42","date_gmt":"2022-02-19T17:01:42","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=54949"},"modified":"2022-02-20T18:34:07","modified_gmt":"2022-02-20T08:34:07","slug":"start-word-suggestions-for-wordle-intersessional-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-intersessional-tutorial\/","title":{"rendered":"Start Word Suggestions for Wordle Intersessional Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Start Word Suggestions for Wordle Intersessional Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper_common.jpg\" title=\"Start Word Suggestions for Wordle Intersessional Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Start Word Suggestions for Wordle Intersessional Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/english-word-guessing-game-intranet-tutorial\/' title='English Word Guessing Game Intranet Tutorial'>English Word Guessing Game Intranet Tutorial<\/a>&#8216;s use of window.<a target=_blank title='window.localStorage information from W3schools' href='https:\/\/www.w3schools.com\/jsref\/prop_win_localstorage.asp'>localStorage<\/a> methodologies got us rethinking the &#8220;Start Word for <a target=_blank title=Wordle href='https:\/\/www.powerlanguage.co.uk\/wordle\/'>Wordle<\/a>&#8221; ideas in the recent <a title='Start Word Suggestions for Wordle Sort Tutorial' href='#swswst'>Start Word Suggestions for Wordle Sort Tutorial<\/a>&#8216;s web application.<\/p>\n<p>Those, again, Javascript <a target=_blank title='Javascript prompt window information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/met_win_prompt.asp'>prompt<\/a> window driven user interactions, are a tad annoying to handle, but if they could be &#8220;standing order&#8221;ised then that might help.  Here we need to store the setting in the web browser, hence the use of HTTP Cookies or window.<a target=_blank title='window.localStorage information from W3schools' href='https:\/\/www.w3schools.com\/jsref\/prop_win_localstorage.asp'>localStorage<\/a> (or window.sessionStorage).<\/p>\n<p>Along the way, we wanted to offer another option, &#8220;common&#8221;, to be a user definable setting saying that words suggested would have to be &#8220;ridgy didge&#8221; in <a target=_blank title='The Free Dictionary' href='\/\/www.thefreedictionary.com'>The Free Dictionary<\/a>, thanks, lexicon.<\/p>\n<p>Getting this going, we realized this might take longer, and when the word &#8220;longer&#8221; comes into play, we (tend to) think <font size=1>(as you would)<\/font> &#8230;<\/p>\n<p><code><br \/>\ndocument.body.style.cursor='progress';<br \/>\n<\/code><\/p>\n<p> &#8230; to signal to the user that processing may take some time.  And for the first time we can remember, we were interested in floating to the right of that &#8220;spinning ball&#8221; <i>progress<\/i> cursor some reason for the wait, that being a (most likely rearranged) version of the Javascript <a target=_blank title='Javascript prompt window information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/met_win_prompt.asp'>prompt<\/a> window entry the user made.<\/p>\n<p>At the Javascript function <i>onl()<\/i> document.body &#8220;onload&#8221; event logic, <font color=blue>changes made<\/font> augment the new &#8220;just before &lt;\/body&gt;&#8221; &lt;div id=cwords&gt;&lt;\/div&gt; initially static HTML element &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\n  <font color=blue>var pointerX = -1;<br \/>\n  var pointerY = -1;<br \/>\n<br \/>\n  function pointerCheck() {<br \/>\n\tif (pointerX != -1) {<br \/>\n\t  document.getElementById('cwords').style.position='absolute';<br \/>\n\t  document.getElementById('cwords').style.top='' + eval(0 + eval('' + pointerY)) + 'px';<br \/>\n\t  document.getElementById('cwords').style.left='' + eval(30 + eval('' + pointerX)) + 'px';<br \/>\n\t  document.getElementById('cwords').style.zIndex='99';<br \/>\n\t  document.getElementById('cwords').style.backgroundColor='orange';<br \/>\n\t  document.getElementById('cwords').innerHTML=document.getElementById('lsbits').title;<br \/>\n\t}<br \/>\n  }<\/font><br \/>\n<br \/> <br \/>\n  function onl() {<br \/>\n   <font color=blue>if (('' + localStorage.getItem('start_word_for_wordle_helper')).replace(\/^null$\/g,'') != '') {<br \/>\n     document.getElementById('lsbits').title=decodeURIComponent(localStorage.getItem('start_word_for_wordle_helper')).replace('&sugnum=',' ').replace(encodeURIComponent('&sugnum='),' ');<br \/>\n     if (document.URL.indexOf('others=') == -1) {<br \/>\n       document.body.style.cursor='progress';<br \/>\n       document.onmousemove = function(event) {  \/\/ thanks to <a target=_blank title='https:\/\/www.codegrepper.com\/code-examples\/javascript\/get+cursor+position+javascript' href='https:\/\/www.codegrepper.com\/code-examples\/javascript\/get+cursor+position+javascript'>https:\/\/www.codegrepper.com\/code-examples\/javascript\/get+cursor+position+javascript<\/a><br \/>\n       if (event.clientX || event.clientY) {<br \/>\n        pointerX = event.clientX;<br \/>\n        pointerY = event.clientY;<br \/>\n       } else {<br \/>\n\t    pointerX = event.pageX;<br \/>\n\t    pointerY = event.pageY;<br \/>\n\t   }<br \/>\n       };<br \/>\n       setInterval(pointerCheck, 1000);<br \/>\n       location.href=(document.URL + '&others=' + (localStorage.getItem('start_word_for_wordle_helper'))).replace('.php&','.php?').replace(encodeURIComponent('&sugnum='),'&sugnum=');<br \/>\n     }<br \/>\n   }<\/font><br \/>\n<br \/>\n   if (window.self !== window.top) {<br \/>\n    document.body.innerHTML = ('' + document.body.innerHTML).replace(\/h1\/g, 'h2');<br \/>\n   }<br \/>\n   makesortable();<br \/>\n  }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; help make this happen.<\/p>\n<p>All this can give <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php----GETME\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php----GETME\" title=\"start_word_for_wordle_helper.php\">start_word_for_wordle_helper.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\" title=\"Click picture\">live run<\/a> an intersessional personalization feel to it.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-sort-tutorial\/'>New Start Word Suggestions for Wordle Sort Tutorial<\/a> ...<\/p>\n\n\n\n\n\n<hr>\n\n\n\n\n\n<p id='swswst'>Previous relevant <a target=_blank title='Start Word Suggestions for Wordle Sort Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-sort-tutorial\/'>Start Word Suggestions for Wordle Sort Tutorial<\/a> is shown below.<\/p>\n\n\n\n[caption id=\"\" align=\"alignnone\" width=\"220\" caption=\"Start Word Suggestions for Wordle Sort Tutorial\"]<a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Start Word Suggestions for Wordle Sort Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper_sort.jpg\" title=\"Start Word Suggestions for Wordle Sort Tutorial\"  style=\"float:left;\"   \/><\/a>[\/caption]\n\n\n\n<p>The webpage created when you execute <a title='Start Word Suggestions for Wordle Iframe Tutorial' href='#swswit'>Start Word Suggestions for Wordle Iframe Tutorial<\/a>'s \"Start Word Suggestions for <a target=_blank title=Wordle href='https:\/\/www.powerlanguage.co.uk\/wordle\/'>Wordle<\/a>\" <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\" title=\"Click picture\">web application<\/a> features a pretty common and traditional form of HTML table element display.<\/p>\n\n\n\n\n\n<p>This HTML <a target=_blank title='HTML table element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_table.asp'>table<\/a> element can \"host\" children and grandchildren and great grandchildren ...<\/p>\n\n\n\n\n\n<ul>\n\n\n<li><a target=_blank title='HTML thead element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_thead.asp'>thead<\/a> (table header \"child\")<\/li>\n\n\n\n\n<li><a target=_blank title='HTML tbody element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_tbody.asp'>tbody<\/a> (table body \"child\" element ... some browsers create a tbody given the lack of a thead and the existence of element(s) below in the static HTML used)<\/li>\n\n\n\n\n<li><a target=_blank title='HTML tr element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_tr.asp'>tr<\/a> (table row \"grandchild\")<\/li>\n\n\n\n\n<li><a target=_blank title='HTML th element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_th.asp'>th<\/a> (table header cell \"great grandchild\")<\/li>\n\n\n\n\n<li><a target=_blank title='HTML td element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_td.asp'>td<\/a> (table body cell \"great grandchild\")<\/li>\n\n\n<\/ul>\n\n\n\n\n\n<p> ... and our table \"static HTML\" (ie. \"the static <font size=1>initial<\/font> design HTML\" before any Javascript DOM comes into play at or after the document.body \"onload\" event) involves \"tr\" and \"th\" and \"td\" elements above, and we become interested in massaging that <font size=1>(via Javascript DOM)<\/font> to host all \"tr -&gt; th\" elements within a derived \"thead\" and all \"tr -&gt; td\" elements within a derived \"tbody\" element, so that \"sorting functionality\" logic can consist of ...<\/p>\n\n\n\n\n\n<ol>\n\n\n<li>add onclick logic for \"th\" elements ... that can ...<\/li>\n\n\n\n\n<li>affect the \"tbody\" innerHTML's \"tr -&gt; td\" element content order ...<\/li>\n\n\n\n\n<li>toggling between \"from highest to lowest\" and \"from lowest to highest\"<\/li>\n\n\n<\/ol>\n\n\n\n\n\n<p> ... so that the scripting and styling code <font color=blue>now looks like<\/font> ...<\/p>\n\n\n\n&lt;?php \n<code>\n<font color=blue>$ondc=\" ondblclick=dictmaybe(this); \";\nif (isset($_GET['nodouble']) || isset($_POST['nodouble'])) { $ondc=\"\";   }<\/font>\n<br \/>\n$hsc=\"&lt;head&gt;\n&lt;title&gt;Start five letter word for Wordle - RJM Programming - February, 2022&lt;\/title&gt;\n&lt;meta id='myviewport' name='viewport' content='width=device-width, initial-scale=1, minimum-scale=0.1, maximum-scale=8, user-scalable=yes' &gt;\n&lt;style&gt;\n  td { \n    text-align: center;\n  }\n<br \/>\n  td:nth-child(2n+1) {  \n    background-color: #f3f7fa;\n  }\n<br \/>\n  th:nth-child(2n+1) {  \n    background-color: #f3f7fa;\n  }\n<br \/>  \n  body {\n    background-color: #f7f7f7;\n  }\n&lt;\/style&gt;\n&lt;script type='text\/javascript'&gt;\n  var wois=null;\n  <font color=blue>var sortrecs=[];\n  var tables=[];\n  var tbodies=[];\n  var theads=[];\n  var ths=[];\n  var trs=[];\n  var tds=[];\n  var parti=0;\n  var lessis=1;\n  var tabih='';\n  var woare=null;\n  var adc=null;<\/font>\n<br \/>  \n  function onl() {\n   if (window.self !== window.top) { \n    document.body.innerHTML = ('' + document.body.innerHTML).replace(\/h1\/g, 'h2'); \n   }\n   <font color=blue>makesortable();<\/font>\n  }\n<br \/>  \n  <font color=blue>function gebtn() {\n   theads=document.<a target=_blank title='Javascript DOM getElementsByTagName() method information from w3schools' href='https:\/\/www.w3schools.com\/jsref\/met_document_getelementsbytagname.asp'>getElementsByTagName<\/a>('thead');\n   tables=document.getElementsByTagName('table');\n   trs=document.getElementsByTagName('tr');\n   tds=document.getElementsByTagName('td');\n   tbodies=document.getElementsByTagName('tbody');\n   ths=document.getElementsByTagName('th');\n  }\n<br \/>  \n  function makesortable() {\n   var itd=0;\n   var jtd=0;\n   var recis='';\n   var thisih='';\n   var nonhead='';\n   var origsrl=eval(sortrecs.length);\n   gebtn();\n   if (eval('' + theads.length) == 0 && eval('' + tbodies.length) &gt; 0 && eval('' + tables.length) &gt; 0 && eval('' + tds.length) &gt; 0 && eval('' + ths.length) &gt; 0 && eval('' + trs.length) &gt; 0) {\n     if (tables[0].innerHTML.indexOf('&lt;tbody&gt;') != -1) {\n      tables[0].innerHTML=tables[0].innerHTML.replace('&lt;tbody&gt;','').replace('&lt;\/tbody&gt;','').replace(trs[0].outerHTML, '&lt;thead&gt;' + trs[0].outerHTML + '&lt;\/thead&gt;');\n      theads=document.getElementsByTagName('thead');\n      tbodies=document.getElementsByTagName('tbody');\n     }\n   }\n   if (eval('' + tbodies.length) == 0 && eval('' + tables.length) &gt; 0 && eval('' + tds.length) &gt; 0) {\n     if (eval('' + ths.length) &gt; 0 && eval('' + trs.length) &gt; 0) {\n       if (eval('' + theads.length) &gt; 0) {\n         nonhead=tables[0].innerHTML.replace(theads[0].outerHTML,'');\n       } else {\n         nonhead=tables[0].innerHTML.replace(trs[0].outerHTML,'');\n       }\n       if (nonhead != '') {\n         tables[0].innerHTML=tables[0].innerHTML.replace(nonhead, '&lt;tbody id=mytbody&gt;' + nonhead + '&lt;\/tbody&gt;');\n         tbodies=document.getElementsByTagName('tbody');\n       }\n     }\n   } \n   if (eval('' + tbodies.length) &gt; 0 && eval('' + tables.length) &gt; 0 && eval('' + tds.length) &gt; 0) {\n     if (eval('' + ths.length) &gt; 0 && eval('' + trs.length) &gt; 0) {\n       recis='';\n       for (itd=0; itd&lt;eval('' + tds.length); itd+=eval('' + ths.length)) {\n         if (itd == 0) {\n           for (jtd=0; jtd&lt;eval('' + ths.length); jtd++) {\n            ths[jtd].title='Click this column ' + eval(1 + jtd) + ' to sort from highest to lowest.';\n            ths[jtd].onclick = function() { sortcol(this);  };\n           }\n         }\n         for (jtd=itd; jtd&lt;eval(itd + eval('' + ths.length)); jtd++) {\n         thisih=tds[jtd].innerHTML;\n         if (thisih.trim() != '') {\n           if (thisih.trim().replace(\/0\/g,'').replace(\/1\/g,'').replace(\/2\/g,'').replace(\/3\/g,'').replace(\/4\/g,'').replace(\/5\/g,'').replace(\/6\/g,'').replace(\/7\/g,'').replace(\/8\/g,'').replace(\/9\/g,'') == '') {\n             recis+=('                    ' + thisih).slice(-20);\n           } else {\n             recis+=(thisih + '                    ').substring(0,20);\n           }\n         } else {\n           recis+='                    ';\n         }\n         if (eval(eval(1 + jtd) % eval('' + ths.length)) == 0) {\n           if (origsrl == 0) { sortrecs.push(recis); }\n           recis='';\n         }\n         }\n       }\n     }\n     if (origsrl == 0) { \n       tabih=tables[0].innerHTML;\n       tables[0].ondblclick = function() { tables[0].innerHTML=tabih; makesortable();  };\n       tables[0].title='Double click me to restore to original sort order.'; \n     }\n   }\n  }\n<br \/>  \n  function compareparts(a, b) {\n    if (a.substring(eval(20 * parti),eval(20 + eval(20 * parti))) == b.substring(eval(20 * parti),eval(20 + eval(20 * parti)))) { \n      if (parti &gt; 0) {  \n        if (a.substring(0,eval(20 * parti)) &lt; b.substring(0,eval(20 * parti))) { \n          return lessis; \n        } else if (a.substring(0,eval(20 * parti)) &gt; b.substring(0,eval(20 * parti))) { \n          return -lessis; \n        } \n      }\n      return 0; \n    }\n    if (a.substring(eval(20 * parti),eval(20 + eval(20 * parti))) &lt; b.substring(eval(20 * parti),eval(20 + eval(20 * parti)))) { return lessis; }\n    return -lessis;\n  }\n<br \/>  \n  function dictmaybe(intdo) {\n    if (('' + intdo.innerHTML) != '' && ('' + intdo.innerHTML).replace(\/0\/g,'').replace(\/1\/g,'').replace(\/2\/g,'').replace(\/3\/g,'').replace(\/4\/g,'').replace(\/5\/g,'').replace(\/6\/g,'').replace(\/7\/g,'').replace(\/8\/g,'').replace(\/9\/g,'') != '') {\n     if (woare) {  if (!woare.closed) {  woare.close(); woare=null;  }  }\n     woare=window.open('\/\/www.thefreedictionary.com\/' + encodeURIComponent(intdo.innerHTML), '_blank', 'top=100,left=' + eval(eval('' + screen.width) \/ 2) + ',width=' + eval(eval('' + screen.width) \/ 2) + ',height=600');\n    }\n  }\n<br \/>  \n  function sortcol(tho) {\n   var ij=0;\n   var kl=0;\n   var tb='';\n   parti=0;\n   if (('' + tho.title).indexOf('Click this column ') == 0 && ('' + tho.title).indexOf(' to sort from ') != -1) {\n     parti=eval(-1 + eval(('' + tho.title).split('Click this column ')[1].split(' ')[0]));\n     if (eval('' + tbodies.length) &gt; 0 && eval('' + tables.length) &gt; 0 && eval('' + tds.length) &gt; 0) {\n       if (('' + tho.title).indexOf(' highest to lowest') != -1) {\n         sortrecs.sort(compareparts);\n         for (ij=0; ij&lt;eval('' + ths.length); ij++) {\n           ths[ij].title=ths[ij].title.replace(' highest to lowest', ' lowest to highest');\n         }\n         tb='';\n         for (kl=0; kl&lt;eval('' + sortrecs.length); kl++) {\n           tb+='&lt;tr&gt;&lt;\/tr&gt;';\n           for (ij=0; ij&lt;eval('' + ths.length); ij++) {\n             tb=tb.replace('&lt;\/tr&gt;', '&lt;td\" . $ondc . \"&gt;' + sortrecs[kl].substring(eval(20 * ij),eval(20 + eval(20 * ij))).trim() + '&lt;\/td&gt;&lt;\/tr&gt;');\n           }\n           tb=tb.replace('&lt;\/tr&gt;', '&lt;\/TR&gt;');\n         }\n         lessis=-lessis;\n       } else {\n         sortrecs.sort(compareparts);\n         for (ij=0; ij&lt;eval('' + ths.length); ij++) {\n           ths[ij].title=ths[ij].title.replace(' lowest to highest', ' highest to lowest');\n         }\n         tb='';\n         for (kl=0; kl&lt;eval('' + sortrecs.length); kl++) {\n           tb+='&lt;tr&gt;&lt;\/tr&gt;';\n           for (ij=0; ij&lt;eval('' + ths.length); ij++) {\n             tb=tb.replace('&lt;\/tr&gt;', '&lt;td\" . $ondc . \"&gt;' + sortrecs[kl].substring(eval(20 * ij),eval(20 + eval(20 * ij))).trim() + '&lt;\/td&gt;&lt;\/tr&gt;');\n           }\n           tb=tb.replace('&lt;\/tr&gt;', '&lt;\/TR&gt;');\n         }\n         lessis=-lessis;\n       }\n       tbodies[0].innerHTML=tb.replace('&lt;\/tr&gt;', '&lt;\/TR&gt;');\n     }\n   }\n  }<\/font>\n<br \/>\n  function mixitup() {\n   var others=prompt('Space separate the word(s) \\\"sort\\\" to sort for Weirdness and\/or \\\"unique\\\" for five letter words with no repeated letters.   Optionally precede by that number of five letter word suggestions to create for use with Wordle, followed by a space character.', '');\n   var clickthis='';\n   if (others == null) { others=''; }\n   others=others.replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'');\n   others=others.toLowerCase().replace('sort',' sort').replace('uniqu',' uniqu');\n   if (others.trim() != '') {\n     var aothers=others.trim().split(' ');\n     if (aothers[0].replace(\/0\/g,'').replace(\/1\/g,'').replace(\/2\/g,'').replace(\/3\/g,'').replace(\/4\/g,'').replace(\/5\/g,'').replace(\/6\/g,'').replace(\/7\/g,'').replace(\/8\/g,'').replace(\/9\/g,'') == '') {\n        document.getElementById('defopt').value='-' + aothers[0];\n        document.getElementById('defopt').innerHTML=aothers[0];\n        document.getElementById('sugnum').value='-' + aothers[0];\n        others=others.replace(aothers[0],'').trim();\n        clickthis='mysub';\n     }\n   }\n   if (others.trim() != '') {\n     var sv=document.getElementById('sugnum').value;\n     document.getElementById('myform').innerHTML+='&lt;input type=hidden name=others value=\\\"' + others + '\\\"&gt;&lt;\/input&gt;';\n     document.getElementById('sugnum').value=sv;\n   }\n   if (clickthis != '') {  document.getElementById(clickthis).click();  }\n  }\n<br \/>    \n&lt;\/script&gt;\n&lt;\/head&gt;\";\n<\/code>\n?&gt;\n\n\n\n<p> ... that augments that \"th\" \"onclick\" event logic with some non-mobile \"ondblclick\" event logic ...<\/p>\n\n\n\n\n\n<ul>\n\n\n<li>for \"table\" that unscrambles any sorting ...<\/li>\n\n\n\n\n<li>for \"td\" cells whose content is not numeric, look up <a target=_blank title='The Free Dictionary' href='\/\/www.thefreedictionary.com'>The Free Dictionary<\/a>, thanks, to try to explain word meanings<\/li>\n\n\n<\/ul>\n\n\n\n\n\n<p> ... for <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php---GETME\">our changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php---GETME\" title=\"start_word_for_wordle_helper.php\">start_word_for_wordle_helper.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\" title=\"Click picture\">live run<\/a> link, <a href='#myswh' title='Below'>or below<\/a>, \"Start Word for Wordle\" web application.<\/p>\n\n  \n\n<!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-sort-tutorial\/'>Start Word Suggestions for Wordle Sort Tutorial<\/a>.<\/p-->\n<hr>\n<p id='swswit'>Previous relevant <a target=_blank title='Start Word Suggestions for Wordle Iframe Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-iframe-tutorial\/'>Start Word Suggestions for Wordle Iframe Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Start Word Suggestions for Wordle Iframe Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper_iframe.jpg\" title=\"Start Word Suggestions for Wordle Iframe Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Start Word Suggestions for Wordle Iframe Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Start Word Suggestions for Wordle Styling and Scripting Tutorial' href='#swswsst'>Start Word Suggestions for Wordle Styling and Scripting Tutorial<\/a>&#8216;s presentation used a hashtag navigation link, &#8220;<a href='#myswh' title='Below'>or below<\/a>&#8220;, to take the user to an HTML iframe hosted execution of our current web application of interest.   Sometimes in such a scenario, you might be dealing with a vastly reduced width and\/or height to work with, and find your presentation to this iframe appears a bit too wide or too high.  And so, today, we outline an idea or two about how to handle that.<\/p>\n<ol>\n<li>decide on a strategy for &#8220;iframe&#8221; modus operandi CSS styling improvement or HTML design improvement or Javascript DOM dynamic styling improvement &#8230; we&#8217;ve decided, today &#8230;<\/li>\n<li>for &#8220;iframe&#8221; modus operandi we want to reduce width by turning the &#8220;h1&#8221; element into an &#8220;h2&#8221; element &#8230; which amounts to an <i>HTML design improvement<\/i> implemented via a Javascript DOM action conduit, as per &#8230;<\/li>\n<li>decide on an intervention point for that <i>Javascript DOM action conduit<\/i> &#8230; you guessed it &#8230; document.body onload event <font color=blue>as the webpage loads<\/font> &#8230;<br \/>\n&lt;?php<br \/>\n<code><br \/>\necho \"&lt;html&gt;\" . $hsc . \"&lt;body<font color=blue> onload=onl();<\/font>&gt;&lt;h1&gt;&lt;span&gt;Start five letter word for &lt;a target=_blank href='\/\/www.powerlanguage.co.uk\/wordle\/'&gt;Wordle&lt;\/a&gt; ... &lt;\/span&gt;&lt;input onclick=mixitup(); title='Allow for Unique Letters, Weirdness Sorting' type=button style=display:inline-block; value='via '&gt;&lt;\/input&gt;&lt;\/span&gt;&lt;form id=myform style=display:inline-block; action=.\/start_word_for_wordle_helper.php method=POST&gt;&lt;input id=mysub type=submit value=Submit style=display:none;&gt;&lt;\/input&gt;&lt;select style=display:inline-block; id=sugnum name=sugnum onchange=document.getElementById('mysub').click();&gt;&lt;option id=defopt value=-\" . $sugnum . \"&gt;\" . $sugnum . \"&lt;\/option&gt;&lt;option value=1&gt;1&lt;\/option&gt;&lt;option value=2&gt;2&lt;\/option&gt;&lt;option value=3&gt;3&lt;\/option&gt;&lt;option value=4&gt;4&lt;\/option&gt;&lt;option value=5&gt;5&lt;\/option&gt;&lt;option value=6&gt;6&lt;\/option&gt;&lt;option value=7&gt;7&lt;\/option&gt;&lt;option value=8&gt;8&lt;\/option&gt;&lt;option value=9&gt;9&lt;\/option&gt;&lt;option value=10&gt;10&lt;\/option&gt;&lt;option value=20&gt;20&lt;\/option&gt;&lt;option value=25&gt;25&lt;\/option&gt;&lt;option value=50&gt;50&lt;\/option&gt;&lt;option value=100&gt;100&lt;\/option&gt;&lt;\/select&gt;&lt;span&gt; suggestions ...&lt;\/span&gt;&lt;\/h1&gt;&lt;h3&gt;RJM Programming ... February, 2022&lt;\/h3&gt;&lt;h4&gt;Suggestions below (bigger associated number, the weirder is the suggestion) ...&lt;\/h4&gt;&lt;br&gt;\" . $tablebit . \"&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n<\/code><br \/>\n?&gt;<br \/>\n &#8230; then &#8230;<\/li>\n<li>write the new Javascript document.body onload event logic &#8230;<br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n  function onl() {<br \/>\n   if (window.self !== window.top) {<br \/>\n    document.body.innerHTML = ('' + document.body.innerHTML).replace(\/h1\/g, 'h2');<br \/>\n   }<br \/>\n  }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<br \/>\n &#8230; a total &#8220;document.body.innerHTML&#8221; (content) solution working here (but is not always a good solution) to change the &#8220;type&#8221; of an element\n<\/li>\n<\/ol>\n<p> &#8230; representing a &#8220;hosting mode of use&#8221; style variation with <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php--GETME\">our changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php--GETME\" title=\"start_word_for_wordle_helper.php\">start_word_for_wordle_helper.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\" title=\"Click picture\">live run<\/a> link, <a href='#myswh' title='Below'>or below<\/a>, web application!<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-iframe-tutorial\/'>Start Word Suggestions for Wordle Iframe Tutorial<\/a>.<\/p-->\n<hr>\n<p id='swswsst'>Previous relevant <a target=_blank title='Start Word Suggestions for Wordle Styling and Scripting Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-styling-and-scripting-tutorial\/'>Start Word Suggestions for Wordle Styling and Scripting Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Start Word Suggestions for Wordle Styling and Scripting Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.gif\" title=\"Start Word Suggestions for Wordle Styling and Scripting Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Start Word Suggestions for Wordle Styling and Scripting Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Start Word Suggestions for Wordle Primer Tutorial' href='#swswpt'>Start Word Suggestions for Wordle Primer Tutorial<\/a> proof of concept &#8220;Start Five Letter Word for <a target=_blank title=Wordle href='https:\/\/www.powerlanguage.co.uk\/wordle\/'>Wordle<\/a> Suggester&#8221; web application managed to create a workable webpage that did not need a <a target=_blank title='HTML head element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_head.asp'>&#8220;head&#8221;<\/a> element.  What are you missing with no &#8220;head&#8221; element?  Primarily &#8230;<\/p>\n<ul>\n<li>scripting (usually <a target=_blank title='HTML script element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_script.asp'>via<\/a> Javascript)<\/li>\n<li>styling (<a target=_blank title='HTML style element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_style.asp'>via<\/a> CSS)<\/li>\n<\/ul>\n<p> &#8230; and, perhaps a webpage title element, and, perhaps <a target=_blank title='HTML meta element information from W3schools' href='https:\/\/www.w3schools.com\/tags\/tag_meta.asp'>&#8220;meta&#8221;<\/a> elements like <a target=_blank title='HTML responsive design information from W3schools' href='https:\/\/www.w3schools.com\/css\/css_rwd_viewport.asp'>&#8220;meta viewport&#8221;<\/a> elements that help with mobile device display (improved visibility, for us).<\/p>\n<p>Within the PHP code we introduced some of all these improvements via &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n$hsc=\"&lt;head&gt;<br \/>\n&lt;title&gt;Start five letter word for Wordle - RJM Programming - February, 2022&lt;\/title&gt;<br \/>\n&lt;meta id='myviewport' name='viewport' content='width=device-width, initial-scale=1, minimum-scale=0.1, maximum-scale=8, user-scalable=yes' &gt;<br \/>\n&lt;style&gt;<br \/>\n  td {<br \/>\n    text-align: center;<br \/>\n  }<br \/>\n<br \/>\n  td:nth-child(2n+1) {<br \/>\n    background-color: #f3f7fa;<br \/>\n  }<br \/>\n<br \/>\n  th:nth-child(2n+1) {<br \/>\n    background-color: #f3f7fa;<br \/>\n  }<br \/>\n<br \/> <br \/>\n  body {<br \/>\n    background-color: #f7f7f7;<br \/>\n  }<br \/>\n&lt;\/style&gt;<br \/>\n&lt;script type='text\/javascript'&gt;<br \/>\n  var wois=null;<br \/>\n  function mixitup() {<br \/>\n   var others=prompt('Space separate the word(s) \\\"sort\\\" to sort for Weirdness and\/or \\\"unique\\\" for five letter words with no repeated letters.   Optionally precede by that number of five letter word suggestions to create for use with Wordle, followed by a space character.', '');<br \/>\n   var clickthis='';<br \/>\n   if (others == null) { others=''; }<br \/>\n<br \/>   others=others.replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'').replace(String.fromCharCode(34),'');<br \/>\n   others=others.toLowerCase().replace('sort',' sort').replace('uniqu',' uniqu');<br \/>\n   if (others.trim() != '') {<br \/>\n     var aothers=others.trim().split(' ');<br \/>\n     if (aothers[0].replace(\/0\/g,'').replace(\/1\/g,'').replace(\/2\/g,'').replace(\/3\/g,'').replace(\/4\/g,'').replace(\/5\/g,'').replace(\/6\/g,'').replace(\/7\/g,'').replace(\/8\/g,'').replace(\/9\/g,'') == '') {<br \/>\n        document.getElementById('defopt').value='-' + aothers[0];<br \/>\n        document.getElementById('defopt').innerHTML=aothers[0];<br \/>\n        document.getElementById('sugnum').value='-' + aothers[0];<br \/>\n        others=others.replace(aothers[0],'').trim();<br \/>\n        clickthis='mysub';<br \/>\n     }<br \/>\n   }<br \/>\n   if (others.trim() != '') {<br \/>\n     var sv=document.getElementById('sugnum').value;<br \/>\n     document.getElementById('myform').innerHTML+='&lt;input type=hidden name=others value=\\\"' + others + '\\\"&gt;&lt;\/input&gt;';<br \/>\n     document.getElementById('sugnum').value=sv;<br \/>\n   }<br \/>\n   if (clickthis != '') {  document.getElementById(clickthis).click();  }<br \/>\n  }<br \/>\n<br \/> <br \/>\n&lt;\/script&gt;<br \/>\n&lt;\/head&gt;\";<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p>It allows us to offer &#8220;sort&#8221; (via word weirdness) and &#8220;uniquify&#8221; (to enforce unique letter sets per five letter word) additional functionality.  We hope you try <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php-GETME\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php-GETME\" title=\"start_word_for_wordle_helper.php\">start_word_for_wordle_helper.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\" title=\"Click picture\">live run<\/a> link, <a href='#myswh' title='Below'>or below<\/a>, to try out these improvements.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-styling-and-scripting-tutorial\/'>Start Word Suggestions for Wordle Styling and Scripting Tutorial<\/a>.<\/p-->\n<hr>\n<p id='swswpt'>Previous relevant <a target=_blank title='Start Word Suggestions for Wordle Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-primer-tutorial\/'>Start Word Suggestions for Wordle Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Start Word Suggestions for Wordle Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.jpg\" title=\"Start Word Suggestions for Wordle Primer Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">Start Word Suggestions for Wordle Primer Tutorial<\/p><\/div>\n<p>A new word game is an interesting phenomenon.  Are you a regular <a target=_blank title=Wordle href='https:\/\/www.powerlanguage.co.uk\/wordle\/'>&#8220;Wordle&#8221;<\/a> player?  We tried it the other day, and see why it&#8217;s addictive.  But it seems to us, a lot relies on that first five letter word guess you make.<\/p>\n<p>And so we decided to try to help out, at least in English, by accessing the macOS and Linux dictionary resources, and add in a &#8220;weirdness score&#8221;, the scoring for which we adopt a &#8220;Scrabble stance&#8221;.   Interested?  Try <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\">start_word_for_wordle_helper.php<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php\">live run<\/a>, or below &#8230;<\/p>\n<p><iframe id=myswh src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/start_word_for_wordle_helper.php?others=10sortunique\" style=\"width:100%;height:800px;\"><\/iframe><\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54864' onclick='var dv=document.getElementById(\"d54864\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/word\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54864' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54868' onclick='var dv=document.getElementById(\"d54868\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/javascript\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54868' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54880' onclick='var dv=document.getElementById(\"d54880\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/type\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54880' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54899' onclick='var dv=document.getElementById(\"d54899\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/sort\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54899' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d54949' onclick='var dv=document.getElementById(\"d54949\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/intersession\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54949' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday&#8217;s English Word Guessing Game Intranet Tutorial&#8216;s use of window.localStorage methodologies got us rethinking the &#8220;Start Word for Wordle&#8221; ideas in the recent Start Word Suggestions for Wordle Sort Tutorial&#8216;s web application. Those, again, Javascript prompt window driven user interactions, &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/start-word-suggestions-for-wordle-intersessional-tutorial\/\">Continue reading <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":{"footnotes":""},"categories":[12,14,15,37],"tags":[155,211,281,2127,326,2848,354,359,400,2212,587,3163,2101,652,776,861,1666,870,894,932,997,1915,1761,1105,1106,1173,2449,2228,1209,1212,1238,3628,3907,3489,3629,2167,3906,1319,1891,3214,1373,1404,1452,1453,3905],"class_list":["post-54949","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-games","category-tutorials","tag-body","tag-click","tag-css","tag-cursor","tag-dictionary","tag-document-getelementsbytagname","tag-dom","tag-double-click","tag-event","tag-head","tag-iframe","tag-interaction","tag-intersession","tag-javascript","tag-meta","tag-onclick","tag-ondblclick","tag-onload","tag-overlay","tag-php","tag-programming","tag-progress","tag-prompt","tag-script","tag-scripting","tag-sort","tag-sorting","tag-standing-order","tag-style","tag-styling","tag-table","tag-tbody","tag-td","tag-th","tag-thead","tag-title","tag-tr","tag-tutorial","tag-user","tag-user-interaction","tag-viewport","tag-web-browser","tag-word","tag-word-game","tag-wordle"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54949"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=54949"}],"version-history":[{"count":6,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54949\/revisions"}],"predecessor-version":[{"id":54955,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54949\/revisions\/54955"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=54949"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=54949"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=54949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}