{"id":57787,"date":"2022-12-15T03:01:03","date_gmt":"2022-12-14T17:01:03","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=57787"},"modified":"2022-12-14T18:06:30","modified_gmt":"2022-12-14T08:06:30","slug":"phphtmljavascript-sudoku-game-collaboration-notifications-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/phphtmljavascript-sudoku-game-collaboration-notifications-tutorial\/","title":{"rendered":"PHP\/HTML\/Javascript Sudoku Game Collaboration Notifications Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"PHP\/HTML\/Javascript Sudoku Game Collaboration Notifications Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/sudoku_collaboration_notifications.jpg\" title=\"PHP\/HTML\/Javascript Sudoku Game Collaboration Notifications Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">PHP\/HTML\/Javascript Sudoku Game Collaboration Notifications Tutorial<\/p><\/div>\n<p>Say the word &#8220;collaboration&#8221;, as with yesterday&#8217;s <a title='HTML\/Javascript Sudoku Game Collaboration Tutorial' href='#html\/jsgct'>HTML\/Javascript Sudoku Game Collaboration Tutorial<\/a> start, and we think, as far as communication conduits go we&#8217;d like to start using &#8230;<\/p>\n<ul>\n<li>notifications <font color=blue>&#8230;<\/font><br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n   function ifcheck() {<br \/>\n    if (eval('' + thenums.length) >= 81) {<br \/>\n      document.getElementById('sudokuif').src='.\/index.php?thegame=' + thenums.substring(0,81) + '&random=' + encodeURIComponent(Math.floor(Math.random() * 19878654));<br \/>\n     var vstabit=tabit;<br \/>\n     if (document.getElementById('tais')) {<br \/>\n       vstabit=document.getElementById('tais').value;<br \/>\n       if (vstabit != tabit) {<br \/>\n         document.getElementById('tais').rows='' + vstabit.split(String.fromCharCode(10)).length;<br \/>\n         tabit=vstabit;<br \/>\n         var hhdate=new Date();<br \/>\n         document.getElementById('sudokui').placeholder='Optionally chat here (bit before a colon is your name) ... last chat was at ' + hhdate;<br \/>\n         document.getElementById('sudokui').focus();<br \/>\n         <font color=blue>if (document.getElementById('tais').value.split(String.fromCharCode(10))[0].trim() != '') {<br \/>\n         if ((lastbofyours.indexOf(document.getElementById('tais').value.split(String.fromCharCode(10))[0].trim()) != -1 && document.getElementById('tais').value.split(String.fromCharCode(10))[0].trim() != '' && lastbofyours != '') || (amhost && document.getElementById('tais').value.split(String.fromCharCode(10))[0].indexOf('Welcome to our Sudoku game') != -1)) {<br \/>\n         tabit=tabit;<br \/>\n         } else {<br \/>\n         if (yourname.trim() != '' && document.getElementById('tais').value.split(String.fromCharCode(10))[0].indexOf(':') == -1) {<br \/>\n         document.getElementById('notif').src='\/HTMLCSS\/notifications_ideas.php?scheduledblurb=' + encodeURIComponent(document.getElementById('tais').value.split(String.fromCharCode(10))[0] + ' (' + yourname + ')');<br \/>\n         } else {<br \/>\n         document.getElementById('notif').src='\/HTMLCSS\/notifications_ideas.php?scheduledblurb=' + encodeURIComponent(document.getElementById('tais').value.split(String.fromCharCode(10))[0]);<br \/>\n         }<br \/>\n         }<br \/>\n         }<\/font><br \/>\n       }<br \/>\n     }<br \/>\n    }<br \/>\n   }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<br \/>\n &#8230; in addition to yesterday&#8217;s &#8230;<\/li>\n<li>email<\/li>\n<li>SMS<\/li>\n<\/ul>\n<p> &#8230; methodologies to aid with communications among users sharing the same <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/sudoku.html---GETME\">modified HTML\/Javascript basis of<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/sudoku.html---GETME\">sudoku.htm<\/a> <a target=_blank title='Sudoku' href='https:\/\/en.wikipedia.org\/wiki\/Sudoku'>Sudoku<\/a> game.<\/p>\n<p>A few more changes involve &#8230;<\/p>\n<ul>\n<li>mechanism to define an optional Sudoku player name <font color=purple>&#8230;<\/font><br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n   <font color=purple>var yourname='';<\/font><br \/>\n<br \/>\n   function iblur(ithis) {<br \/>\n    thenums='';<br \/>\n    var esels=document.getElementsByTagName('select');<br \/>\n    for (var ejj=0; ejj&lt;esels.length; ejj++) {<br \/>\n      if (('' + esels[ejj].id) != 'smode') {<br \/>\n        thenums+=esels[ejj].getAttribute('data-answer');<br \/>\n      }<br \/>\n    }<br \/>\n     if (ithis.value.trim() != '' && eval('' + thenums.length) &gt;= 81) {<br \/>\n      <font color=purple>if (yourname == '' && ithis.value.indexOf(':') != -1) {<br \/>\n        yourname=ithis.value.split(':')[0];<br \/>\n      } else if (ithis.value.indexOf(':') != -1) {<br \/>\n        if (ithis.value.split(':')[0].indexOf(' ') == -1) {<br \/>\n          yourname=ithis.value.split(':')[0];<br \/>\n        }<br \/>\n      }<\/font><br \/>\n     \/\/alert('yes');<br \/>\n      ithis.value=ithis.value.replace(\/\\\/\/g,' ').replace(\/\\*\/g,' ').replace(\/\\;\/g,' ').replace(\/\\\\\\\"\/g,' ').replace(\/\\'\/g,' ').replace(\/\\(\/g,'{').replace(\/\\)\/g,'}');<br \/>\n      if (yourname.trim() != '' && ithis.value.indexOf(':') == -1) {<br \/>\n        ithis.value=yourname + ': ' + ithis.value;<br \/>\n      }<br \/>\n      lastbofyours=ithis.value;<br \/>\n      document.getElementById('sudokuif').src='.\/index.php?thegame=' + tenminus(thenums.substring(0,81)) + '&newmsg=' + encodeURIComponent(ithis.value);<br \/>\n      var hdate=new Date();<br \/>\n      ithis.title='Last chat you contributed at ' + hdate + ' was ... ' + ithis.value.replace(String.fromCharCode(34),String.fromCharCode(39)).replace(String.fromCharCode(34),String.fromCharCode(39));<br \/>\n      ithis.value='';<br \/>\n      ithis.placeholder='Optionally chat here (bit before a colon is your name) ... last chat was at ' + hdate;<br \/>\n     } \/\/else {<br \/>\n     \/\/alert('no');<br \/>\n     \/\/}<br \/>\n   }<br \/>\n<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;\n<\/li>\n<li>indent user player chat in chronological order of appearance <font color=olive>&#8230;<\/font><br \/>\n&lt;?php<br \/>\n<code><br \/>\nif (isset($_GET['thegame']) && isset($_GET['random'])) {<br \/>\n <font color=olive>$sofarx=\";\";<br \/>\n $thisb=\"\";<br \/>\n $maxb=\"\";<\/font><br \/>\n $allcontentx=file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'index.php');<br \/>\n $lcsx=explode('\/' . '*', $allcontentx);<br \/>\n \/\/file_put_contents('azx.azx', '' . sizeof($lcs) . ' ' . $cuda . ';' . $thisset);<br \/>\n if (sizeof($lcsx) &gt; 1) {<br \/>\n   $collabx=explode('*' . '\/', $lcsx[1])[0];<br \/>\n   $linesx=explode(\"\\n\", $collabx);<br \/>\n   $thisxset=str_replace('+',' ',urldecode($_GET['thegame'])); \/\/'' . str_replace('(','9',str_replace('*','8',str_replace('&','7',str_replace('^','6',str_replace('$','4',str_replace('#','3',str_replace('@','2',str_replace('!','1',str_replace('1','(',str_replace('2','*',str_replace('3','&',str_replace('4','^',str_replace('6','$',str_replace('7','#',str_replace('8','@',str_replace('9','!',str_replace('+',' ',urldecode($_GET['thegame']))))))))))))))))));<br \/>\n   \/\/$thisxset='' . str_replace('(','9',str_replace('*','8',str_replace('&','7',str_replace('^','6',str_replace('$','4',str_replace('#','3',str_replace('@','2',str_replace('!','1',str_replace('1','(',str_replace('2','*',str_replace('3','&',str_replace('4','^',str_replace('6','$',str_replace('7','#',str_replace('8','@',str_replace('9','!',str_replace('+',' ',urldecode($_GET['thegame']))))))))))))))))));<br \/>\n   $taxbit=\"\";<br \/>\n   for ($ilx=0; $ilx&lt;sizeof($linesx); $ilx++) {<br \/>\n     <font color=olive>if ($sofarx == \";\") {<br \/>\n       $sofarx.=str_replace('   ',' + ',str_replace('+',' ',urldecode(explode(';', $linesx[$ilx])[1]))) . ';';<br \/>\n     } else if (sizeof(explode(';' . explode(';', $linesx[$ilx])[1] . ';', $sofarx)) == 1) {<br \/>\n       $maxb.=\" \";<br \/>\n       $thisb=$maxb;<br \/>\n       $sofarx.=str_replace('   ',' + ',str_replace('+',' ',urldecode(explode(';', $linesx[$ilx])[1]))) . ';';<br \/>\n     } else {<br \/>\n       $rest=explode(';' . explode(';', $linesx[$ilx])[1] . ';', $sofarx)[0];<br \/>\n       $thisb=\"\";<br \/>\n       if ($rest != \"\") {<br \/>\n         for ($iop=1; $iop&lt;sizeof(explode(';', $rest)); $iop++) {<br \/>\n           $thisb.=\" \";<br \/>\n         }<br \/>\n       }<br \/>\n     }<\/font><br \/>\n     $parts=explode('' . $thisxset . ';', $linesx[$ilx]);<br \/>\n     if (sizeof($parts) == 2) {<br \/>\n       $taxbit=<font color=olive>$thisb . <\/font>str_replace('   ',' + ',str_replace('+',' ',urldecode($parts[1]))) . \"\\n\" . $taxbit;<br \/>\n     }<br \/>\n   }<br \/>\n   if ($taxbit != \"\") {<br \/>\n     echo '&lt;html&gt;&lt;body onload=\" parent.document.getElementById(' . \"'toright'\" . ').style.display=' . \"'table-cell'\" . '; parent.document.getElementById(' . \"'tais'\" . ').value=' . \"'\" . str_replace(\"\\n\",\"' + String.fromCharCode(10) + '\",$taxbit) . \"'\" . '; \"&gt;&lt;\/body&gt;&lt;\/html&gt;';<br \/>\n   }<br \/>\n }<br \/>\n exit;<br \/>\n<\/code><br \/>\n?&gt;\n<\/li>\n<li>textarea background image linear gradient to highlight latest chat item <font color=magenta>&#8230;<\/font><br \/>\n&lt;style&gt;<br \/>\n<code><br \/>\n .bright { border-right: 5px solid black; }<br \/>\n .bbottom { border-bottom: 5px solid black; }<br \/>\n td { font-size: 24px; width: 11%; height: 9%; text-align: center; vertical-align: middle; }<br \/>\n select { font-size: 24px; }<br \/>\n th { text-align: left; vertical-align: top; }<br \/>\n textarea { width: 95%; <font color=magenta>background-image: linear-gradient(rgba(255,255,0,0.5) 20px, white 8%);<\/font> }<br \/>\n input { width: 95%; }<br \/>\n<\/code><br \/>\n&lt;\/style&gt;\n<\/li>\n<li>local date of last chat item shown <font color=brown>&#8230;<\/font><br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n   function iblur(ithis) {<br \/>\n    thenums='';<br \/>\n    var esels=document.getElementsByTagName('select');<br \/>\n    for (var ejj=0; ejj&lt;esels.length; ejj++) {<br \/>\n      if (('' + esels[ejj].id) != 'smode') {<br \/>\n        thenums+=esels[ejj].getAttribute('data-answer');<br \/>\n      }<br \/>\n    }<br \/>\n     if (ithis.value.trim() != '' && eval('' + thenums.length) &gt;= 81) {<br \/>\n      if (yourname == '' && ithis.value.indexOf(':') != -1) {<br \/>\n        yourname=ithis.value.split(':')[0];<br \/>\n      } else if (ithis.value.indexOf(':') != -1) {<br \/>\n        if (ithis.value.split(':')[0].indexOf(' ') == -1) {<br \/>\n          yourname=ithis.value.split(':')[0];<br \/>\n        }<br \/>\n      }<br \/>\n     \/\/alert('yes');<br \/>\n      ithis.value=ithis.value.replace(\/\\\/\/g,' ').replace(\/\\*\/g,' ').replace(\/\\;\/g,' ').replace(\/\\\\\\\"\/g,' ').replace(\/\\'\/g,' ').replace(\/\\(\/g,'{').replace(\/\\)\/g,'}');<br \/>\n      if (yourname.trim() != '' && ithis.value.indexOf(':') == -1) {<br \/>\n        ithis.value=yourname + ': ' + ithis.value;<br \/>\n      }<br \/>\n      lastbofyours=ithis.value;<br \/>\n      document.getElementById('sudokuif').src='.\/index.php?thegame=' + tenminus(thenums.substring(0,81)) + '&newmsg=' + encodeURIComponent(ithis.value);<br \/>\n      <font color=brown>var hdate=new Date();<\/font><br \/>\n      ithis.title='Last chat you contributed at ' + hdate + ' was ... ' + ithis.value.replace(String.fromCharCode(34),String.fromCharCode(39)).replace(String.fromCharCode(34),String.fromCharCode(39));<br \/>\n      ithis.value='';<br \/>\n      ithis.placeholder='Optionally chat here (bit before a colon is your name) ... <font color=brown>last chat was at <\/font>'<font color=brown> + hdate<\/font>;<br \/>\n     } \/\/else {<br \/>\n     \/\/alert('no');<br \/>\n     \/\/}<br \/>\n   }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;\n<\/li>\n<\/ul>\n<p> &#8230; to round out <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/index.php--GETME\">the tweaked collaboration and sharing logic for<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/index.php--GETME\">index.php<\/a> PHP <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/\">Sudoku game<\/a> that you should <a onmouseover=\"document.getElementById('mysiframe').src='\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/index.php';\"   onclick=\"if ((document.getElementById('mysiframe').src + '?').indexOf('.php?') == -1) { document.getElementById('mysiframe').src='\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/index.php'; } location.href='#mysiframe';\" data-href='#mysiframe' style=\"text-decoration:underline;cursor:pointer;\">feel free to try <font size=1>and collaborate with<\/font> below<\/a>, as well.<\/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\/phphtmljavascript-sudoku-game-collaboration-tutorial\/'>HTML\/Javascript Sudoku Game Collaboration Notifications Tutorial<\/a>.<\/p-->\n<hr>\n<p id='html\/jsgct'>Previous relevant <a target=_blank title='HTML\/Javascript Sudoku Game Collaboration Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/html\/javascript-sudoku-game-collaboration-tutorial\/'>HTML\/Javascript Sudoku Game Collaboration Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"HTML\/Javascript Sudoku Game Collaboration Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/sudoku_collaboration.jpg\" title=\"HTML\/Javascript Sudoku Game Collaboration Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">HTML\/Javascript Sudoku Game Collaboration Tutorial<\/p><\/div>\n<p>Onto yesterday&#8217;s <a title='HTML\/Javascript Sudoku Personalized Game Tutorial' href='#html\/jspgt'>HTML\/Javascript Sudoku Personalized Game Tutorial<\/a>&#8216;s progress with our <a target=_blank title='Sudoku' href='https:\/\/en.wikipedia.org\/wiki\/Sudoku'>Sudoku<\/a> game is today&#8217;s collaboration and sharing phase, offering &#8230;<\/p>\n<ul>\n<li>email<\/li>\n<li>SMS<\/li>\n<\/ul>\n<p> &#8230; conduits to involving outside parties into your Sudoku &#8220;party&#8221;, via an invitation to the relevant emailee or mobile number, respectively.  Once the invites are answered, it can be like a chat session for the collaborators, featuring &#8230;<\/p>\n<ul>\n<li>textbox (input type=text) chat elements &#8230; and an accumulated &#8230;<\/li>\n<li>textarea total chat session (most recent to the top)<\/li>\n<\/ul>\n<p>What goes to make up this &#8220;chat&#8221; feature?<\/p>\n<ul>\n<li>start involving PHP as the \/Games\/Sudoku\/ default webpage<\/li>\n<li>using that PHP itself to store data required to make this happen (effectively the &#8220;chat&#8221; data source) via the PHP reading its own content (as well as the content of <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/sudoku.html--GETME\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/sudoku.html--GETME\">sudoku.htm<\/a>)<\/li>\n<li>calling the self same PHP with different $_GET[] arguments in a child iframe element at regular intervals, and, as necessary, update the textarea content above<\/li>\n<\/ul>\n<p> &#8230; as <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/index.php-GETME\">the collaboration and sharing logic added to<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/index.php-GETME\">index.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/\">Sudoku game<\/a> that you should <a onmouseover=\"document.getElementById('mysiframe').src='\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/index.php';\"   onclick=\"if ((document.getElementById('mysiframe').src + '?').indexOf('.php?') == -1) { document.getElementById('mysiframe').src='\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/index.php'; } location.href='#mysiframe';\" data-href='#mysiframe' style=\"text-decoration:underline;cursor:pointer;\">feel free to try <font size=1>and collaborate with<\/font> below<\/a>, as well.<\/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\/htmljavascript-sudoku-personalized-game-collaboration-tutorial\/'>HTML\/Javascript Sudoku Game Collaboration Tutorial<\/a>.<\/p-->\n<hr>\n<p id='html\/jspgt'>Previous relevant <a target=_blank title='HTML\/Javascript Sudoku Personalized Game Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/html\/javascript-sudoku-personalized-game-tutorial\/'>HTML\/Javascript Sudoku Personalized Game Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/sudoku.htm\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"HTML\/Javascript Sudoku Personalized Game Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/sudoku_tailored.jpg\" title=\"HTML\/Javascript Sudoku Personalized Game Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">HTML\/Javascript Sudoku Personalized Game Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='HTML\/Javascript Sudoku Game Primer Tutorial' href='#html\/jsgpt'>HTML\/Javascript Sudoku Game Primer Tutorial<\/a> gave us a &#8220;first draft&#8221; look at the <a target=_blank title='Sudoku' href='https:\/\/en.wikipedia.org\/wiki\/Sudoku'>Sudoku<\/a> game which featured &#8230;<\/p>\n<ul>\n<li>an inflexible &#8220;Easy&#8221; and &#8220;Hard&#8221; mode of use, using a set pattern of revealed squares &#8230;<br \/>\n<code><br \/>\n  var easyarr=',3,4,7,10,12,14,15,19,20,27,28,29,30,32,34,39,41,44,45,49,51,52,55,57,59,61,67,68,70,71,74,75,76,80,';<br \/>\n  var hardarr=',1,5,8,9,13,19,21,28,33,36,37,39,43,49,52,54,61,62,63,67,69,70,72,80,';<br \/>\n<\/code><br \/>\n &#8230; but, today, as a personalization measure, we allow &#8230;<\/li>\n<li>user control over that pattern of revealed squares (via a new &#8220;Tailored&#8221; option in the top mode of play dropdown) &#8230;<br \/>\n<code><br \/>\n  var mustbeguessed=location.search.split('mustbeguessed=')[1] ? decodeURIComponent(location.search.split('mustbeguessed=')[1].split('&')[0]) : '';<br \/>\n  var mustnotbeguessed=location.search.split('mustnotbeguessed=')[1] ? decodeURIComponent(location.search.split('mustnotbeguessed=')[1].split('&')[0]) : '';<br \/>\n<br \/>\n  function askmaybe(indef) {<br \/>\n    var tans='';<br \/>\n    var tpars='';<br \/>\n    if (indef.indexOf('tailored=') == 0) {<br \/>\n      tans=prompt('Using square numbers of 9x9 grid from 1 to 81, specify in comma separated list, where prefixed by minus would be pre-answered else represents squares to be answered, for Sudoku game to follow. To remember for the future involve leading or trailing spaces.  Involve an x to delete any pre-existing saved tailored Sudoku game configurations.', '');<br \/>\n      if (tans == null) { tans=''; }<br \/>\n      var atansarr=tans.replace(\/x\/g,'').replace(\/X\/g,'').split(',');<br \/>\n      if (gls!= '' && tans.toLowerCase().indexOf('x') != -1) {<br \/>\n            window.<a target=_blank title='window.localStorage information from W3schools' href='https:\/\/www.w3schools.com\/jsref\/prop_win_localstorage.asp'>localStorage<\/a>.removeItem('sudokudefs');<br \/>\n            gls='';<br \/>\n      }<br \/>\n      for (var it=0; it&lt;atansarr.length; it++) {<br \/>\n       if (('' + atansarr[it]).trim() != '') {<br \/>\n        if (('' + atansarr[it] + ' ').indexOf('-') == 0) {<br \/>\n          if (tpars.indexOf('mustnotbeguessed=') == -1) { tpars+='&mustnotbeguessed=' + atansarr[it].trim().substring(1);  } else {  tpars=tpars.replace('&mustnotbeguessed=', '&mustnotbeguessed=' + atansarr[it].trim().substring(1) + ','); }<br \/>\n        } else {<br \/>\n          if (tpars.indexOf('mustbeguessed=') == -1) { tpars+='&mustbeguessed=' + atansarr[it].trim();  } else {  tpars=tpars.replace('&mustbeguessed=', '&mustbeguessed=' + atansarr[it].trim() + ','); }<br \/>\n        }<br \/>\n       }<br \/>\n      }<br \/>\n      if (tpars != '') {<br \/>\n        <font color=blue>if (tans.trim() != tans) {<br \/>\n          if (getls() != '') {<br \/>\n            window.localStorage.removeItem('sudokudefs');<br \/>\n          }<br \/>\n          window.localStorage.setItem('sudokudefs', encodeURIComponent(tpars.substring(1)));<br \/>\n        }<\/font><br \/>\n        return tpars.substring(1);<br \/>\n      }<br \/>\n    }<br \/>\n    return indef;<br \/>\n  }<br \/>\n<\/code><br \/>\n &#8230; as well as a way to have &#8230;<\/li>\n<li><font color=blue>recallable user control<\/font> over that pattern of revealed squares &#8230;<br \/>\n<code><br \/>\n  <font color=blue>var gls=getls();<br \/>\n<br \/>\n  function getls() {<br \/>\n    return decodeURIComponent(('' + window.localStorage.getItem('sudokudefs')).replace(\/^undefined\/g,'').replace(\/^null\/g,''));<br \/>\n  }<br \/>\n  <br \/>\n  function checkls() {<br \/>\n    if (gls != '' && document.URL.indexOf('?') == -1) {<br \/>\n      location.href=document.URL.split('#')[0].split('?')[0] + '?' + gls;<br \/>\n    }<br \/>\n  }<\/font><br \/>\n<br \/>\n\/\/ via document.body onload call via ... &lt;body onload=\"<font color=blue>checkls();<\/font> while (!okay) { okay=newgame(); }\"&gt;<br \/>\n<\/code>\n<\/li>\n<\/ul>\n<p> &#8230; meaning you can set up a personalized Sudoku level of difficulty called upon each time you start it up again when using the same device and web browser combination with <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/sudoku.html-GETME\">our changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/sudoku.html-GETME\">sudoku.htm<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/sudoku.htm\">Sudoku<\/a> game <a onmouseover=\"document.getElementById('mysiframe').src='\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/sudoku.htm';\"   onclick=\"if ((document.getElementById('mysiframe').src + '?').indexOf('.htm?') == -1) { document.getElementById('mysiframe').src='\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/sudoku.htm'; } location.href='#mysiframe';\" data-href='#mysiframe' style=\"text-decoration:underline;cursor:pointer;\">feel free to try below<\/a>, as well.<\/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\/html\/javascript-sudoku-personalized-game-tutorial\/'>HTML\/Javascript Sudoku Personalized Game Tutorial<\/a>.<\/p-->\n<hr>\n<p id='html\/jsgpt'>Previous relevant <a target=_blank title='HTML\/Javascript Sudoku Game Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/html\/javascript-sudoku-game-primer-tutorial\/'>HTML\/Javascript Sudoku Game 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\/Games\/Sudoku\/sudoku.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"HTML\/Javascript Sudoku Game Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/sudoku.jpg\" title=\"HTML\/Javascript Sudoku Game Primer Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">HTML\/Javascript Sudoku Game Primer Tutorial<\/p><\/div>\n<p>Today we&#8217;ve got an inhouse version of a well known mathematical <font size=1>(but you don&#8217;t have to be a mathematician to play)<\/font> game called <a target=_blank title='Sudoku' href='https:\/\/en.wikipedia.org\/wiki\/Sudoku'>Sudoku<\/a> which you regularly find in the puzzles section of the newspaper, like the KenKen game of <a title='HTML\/Javascript KenKen Game Primer Tutorial' href='#html\/jkkgpt'>HTML\/Javascript KenKen Game Primer Tutorial<\/a> times.<\/p>\n<p>The rules are, for our version &#8230;<\/p>\n<ul>\n<li>there are 81 squares in a 9&#215;9 grid that need to get assigned a counting number from 1 to 9, but some are filled out already to help you<\/li>\n<li>no row of nine should contain a duplicate counting number<\/li>\n<li>no column of nine should contain a duplicate counting number<\/li>\n<li>none of the 9 3&#215;3 squares within that 9&#215;9 grid should contain a duplicate counting number<\/li>\n<\/ul>\n<p>Simple, when put like that, but can be quite challenging in the solving!<\/p>\n<p>Feel free to try our <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/sudoku.html_GETME\" title=\"sudoku.html\">first draft sudoku.html<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/sudoku.html\" title=\"Click picture\">Suduko game<\/a> you can try in a new window, or below &#8230;<\/p>\n<p><iframe id=mysiframe src=\"http:\/\/www.rjmprogramming.com.au\/Games\/Sudoku\/sudoku.html\" style=\"width:100%;height:900px;\"><\/iframe><\/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\/htmljavascript-sudoku-game-primer-tutorial\/'>HTML\/Javascript Sudoku Game Primer Tutorial<\/a>.<\/p-->\n<hr>\n<p id='html\/jkkgpt'>Previous relevant <a target=_blank title='HTML\/Javascript KenKen Game Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/html\/javascript-kenken-game-primer-tutorial\/'>HTML\/Javascript KenKen Game 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\/HTMLCSS\/kenken.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"HTML\/Javascript KenKen Game Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/kenken.jpg\" title=\"HTML\/Javascript KenKen Game Primer Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">HTML\/Javascript KenKen Game Primer Tutorial<\/p><\/div>\n<p>KenKen is a well known mathematical game, featuring in the puzzle section of some newspapers.  We see it here in Sydney, Australia, in <a target=_blank title='The Sydney Morning Herald' href='http:\/\/www.smh.com.au\/\u200e'>The Sydney Morning Herald<\/a> newspaper.<\/p>\n<p>Do not know what the paper KenKen puzzle creators use to create their KenKen puzzles, but we do end up with a bit of a trial and error approach (populating the KenKen grid with numbers).<\/p>\n<p>Am sure if you are interested in the methodology you would not have too much trouble seeing what we did by examining the HTML and Javascript code you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/kenken.html_GETME\" title='kenken.html'>kenken.html<\/a><\/p>\n<p>KenKen consists of a grid (ours is 6&#215;6) of numbers (from 1 to 6) not repeated horizontally nor vertically within that grid.<\/p>\n<p>The user solving the KenKen puzzle is not shown those numbers, except the ones caught in a 1&#215;1 &#8220;cage&#8221; &#8230; and these can help you greatly to solve the puzzle, the rest of which is made up of 1&#215;2 and 1&#215;3 &#8220;cages&#8221; that have a &#8220;clue&#8221; &#8230; for example &#8230;<\/p>\n<ul>\n<li>\n<table>\n<tr>\n<div align='center'>\n<td style='border:11px solid green'><sup style='color:red;'>12*<\/sup><select><option><\/option><option value=1>1<\/option><option value=2>2<\/option><option value=3>3<\/option><option value=4>4<\/option><option value=5>5<\/option><option value=6>6<\/option><\/select><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<\/li>\n<li>\n<table>\n<tr>\n<div align='center'>\n<td style='border:11px solid green'><sup style='color:red;'>7+<\/sup><select><option><\/option><option value=1>1<\/option><option value=2>2<\/option><option value=3>3<\/option><option value=4>4<\/option><option value=5>5<\/option><option value=6>6<\/option><\/select><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<\/li>\n<li>\n<table>\n<tr>\n<div align='center'>\n<td style='border:11px solid green'><sup style='color:red;'>3-<\/sup><select><option><\/option><option value=1>1<\/option><option value=2>2<\/option><option value=3>3<\/option><option value=4>4<\/option><option value=5>5<\/option><option value=6>6<\/option><\/select><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<\/li>\n<li>\n<table>\n<tr>\n<div align='center'>\n<td style='border:11px solid green'><sup style='color:red;'>2\/<\/sup><select><option><\/option><option value=1>1<\/option><option value=2>2<\/option><option value=3>3<\/option><option value=4>4<\/option><option value=5>5<\/option><option value=6>6<\/option><\/select><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<\/li>\n<\/ul>\n<p> &#8230; which tell you a clue about the numbers you can use dropdowns with which to solve.<\/p>\n<p>There is no surprise with the HTML &#8220;grid&#8221; being composed of an HTML <a target=_blank title='HTML table information from w3schools' href='http:\/\/www.w3schools.com\/html\/html_tables.asp'>table<\/a> element, shadowed by a multi-dimensional array we initialize for our 6&#215;6 grid scenario via &#8230;<\/p>\n<p><code><br \/>\nvar mda=[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]];<br \/>\n<\/code><\/p>\n<p> in the Javascript.<\/p>\n<p>You&#8217;ll see that we made use of the HTML <a target=_blank title='HTML sup tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_sup.asp'>sup<\/a> tag for a superimposed feel to the clues within some of the grid squares at the start of the &#8220;cage&#8221;.<\/p>\n<p>Hope you get some HTML and Javascript ideas about games, and have fun playing this mathematical and logic game, today, with our <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/kenken.html\" title='click picture'>live run<\/a>.<\/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='#d15724' onclick='var dv=document.getElementById(\"d15724\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=mathematics\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d15724' 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='#d57763' onclick='var dv=document.getElementById(\"d57763\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/game\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d57763' 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='#d57770' onclick='var dv=document.getElementById(\"d57770\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/localStorage\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d57770' 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='#d57780' onclick='var dv=document.getElementById(\"d57780\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/collaborate\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d57780' 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='#d57787' onclick='var dv=document.getElementById(\"d57787\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/notifications\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d57787' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Say the word &#8220;collaboration&#8221;, as with yesterday&#8217;s HTML\/Javascript Sudoku Game Collaboration Tutorial start, and we think, as far as communication conduits go we&#8217;d like to start using &#8230; notifications &#8230; &lt;?php echo &#8221; function ifcheck() { if (eval(&#8221; + thenums.length) &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/phphtmljavascript-sudoku-game-collaboration-notifications-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":[2914,1835,1580,200,1604,4173,3136,290,1785,354,367,380,429,430,476,2298,576,609,625,652,2020,2415,739,752,3004,3861,846,2791,919,932,997,3274,1866,1133,1137,1159,4172,1238,1262,1675,1319],"class_list":["post-57787","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-games","category-tutorials","tag-_get","tag-arguments","tag-cell","tag-chat","tag-collaboration","tag-comments","tag-conduit","tag-data","tag-data-source","tag-dom","tag-dropdown","tag-email","tag-file_get_contents","tag-file_put_contents","tag-game","tag-grid","tag-html","tag-input","tag-invitation","tag-javascript","tag-linear-gradient","tag-localstorage","tag-mailto","tag-mathematics","tag-maths","tag-mode","tag-notification","tag-notifications","tag-personalization","tag-php","tag-programming","tag-recall","tag-select","tag-share","tag-sharing","tag-sms","tag-sudoku","tag-table","tag-textarea","tag-textbox","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/57787"}],"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=57787"}],"version-history":[{"count":2,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/57787\/revisions"}],"predecessor-version":[{"id":57789,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/57787\/revisions\/57789"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=57787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=57787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=57787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}