{"id":54923,"date":"2022-02-16T03:01:57","date_gmt":"2022-02-15T17:01:57","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=54923"},"modified":"2022-02-15T19:24:10","modified_gmt":"2022-02-15T09:24:10","slug":"english-word-guessing-game-player-equality-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/english-word-guessing-game-player-equality-tutorial\/","title":{"rendered":"English Word Guessing Game Player Equality Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"English Word Guessing Game Player Equality Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word_players.jpg\" title=\"English Word Guessing Game Player Equality Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">English Word Guessing Game Player Equality Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='English Word Guessing Game Players Tutorial' href='#ewggpt'>English Word Guessing Game Players Tutorial<\/a> started multi-player scenarios with our &#8220;English Word Guessing Game&#8221; web application, but was a bit &#8220;amateur hour&#8221; in its approach, regarding &#8230;<\/p>\n<ul>\n<li>premature, and too simple, (textbox) onblur event programmatical form submit button clicking logic &#8230; <font size=1>and now we check on answer length<\/font><\/li>\n<li>number (in fact, all) characters were accepted as legitimate &#8220;word answer&#8221; characters &#8230; <font size=1>and now we allow keyboard numeric <a target=_blank title='Hotkey' href='https:\/\/javascript.info\/keyboard-events'>&#8220;hotkeys&#8221;<\/a> focus that player&#8217;s textbox, via &#8220;onkeydown&#8221; keyboard event logic &#8230;<br \/>\n&lt;?php echo &#8221;<br \/>\n<code><br \/>\n&lt;script type='text\/javascript'&gt;<br \/>\n function isitnum(event) {<br \/>\n  if (eval('' + event.keyCode) &gt;= 48 && eval('' + event.keyCode) &lt;= 57) {<br \/>\n    top.setgl(eval(-48 + eval('' + event.keyCode)));<br \/>\n    return false;<br \/>\n  }<br \/>\n  return true;<br \/>\n }<br \/>\n&lt;\/script&gt;<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<br \/>\n<\/font><\/li>\n<li>players were referred to by number only &#8230; <font size=1>and now we allow for player name to be entered via a preceding (the question) span <i>contenteditable=true<\/i> element<\/font>\n<\/ul>\n<p> &#8230; meaning the one device (perhaps a mobile one) can have a hovering group of players who all see, for any multi-player game screen, the possibility to be answering via &#8230;<\/p>\n<ul>\n<li>click or tap of a button &#8230; to establish their textbox&#8217;s focus &#8230; and\/or &#8230;<\/li>\n<li>keyboard numeric hotkeys &#8230; to establish their textbox&#8217;s focus &#8230; and alpha letters to complete their answers<\/li>\n<\/ul>\n<p> &#8230; and once a player reaches the length of their answer, they can send that answer off for analysis via any of &#8230;<\/p>\n<ul>\n<li>that player tabs out of their textbox &#8230; or &#8230;<\/li>\n<li>that player clicks or taps their &#8220;Correct?&#8221; form submit button &#8230; or &#8230;<\/li>\n<li>a keyboard numeric for another player number is pressed<\/li>\n<\/ul>\n<p> &#8230; for <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php--GETME\" title=\"what_is_the_english_word.php\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php--GETME\" title=\"what_is_the_english_word.php\">what_is_the_english_word.php<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php\" title=\"Click picture\">English Word Guessing Game<\/a> &#8230;<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word_mobile.png\" style=\"width:100%;\"><\/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\/english-word-guessing-game-player-equality-tutorial\/'>English Word Guessing Game Player Equality Tutorial<\/a>.<\/p-->\n<hr>\n<p id='ewggpt'>Previous relevant <a target=_blank title='English Word Guessing Game Players Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/english-word-guessing-game-players-tutorial\/'>English Word Guessing Game Players 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\/what_is_the_english_word.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"English Word Guessing Game Players Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word_oldplayers.jpg\" title=\"English Word Guessing Game Players Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">English Word Guessing Game Players Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='English Word Guessing Game Primer Tutorial' href='#ewggpt'>English Word Guessing Game Primer Tutorial<\/a>&#8216;s &#8220;English Word Guessing Game&#8221; suited one player.   Today, we allow the user to set the number of players to &#8230;<\/p>\n<ul>\n<li>each nominated player plays within an HTML iframe element with an overall HTML table element within an HTML body element &#8230; meaning &#8230;<\/li>\n<li>until tomorrow&#8217;s work, it is &#8220;dog eat dog&#8221; as to who controls which player&#8217;s textbox has the focus &#8230; but &#8230;<\/li>\n<li>scoring is asynchronous<\/li>\n<li>until tomorrow&#8217;s work, the use of the tab character to tab out of a textbox clicks the &#8220;Correct?&#8221; button to go off to assess that player&#8217;s answer<\/li>\n<\/ul>\n<p>&lt;?php<br \/>\n<code><br \/>\n$score=0;<br \/>\n$goes=0;<br \/>\n$blurb='';<br \/>\n$dblurb=\"Score: 0\/0\";<br \/>\n$totalj=0;<br \/>\n$fortyeight=\"48\";<br \/>\n$fortyeighti=\"\";<br \/>\n$fortyeightj=\"\";<br \/>\n$ob=\"\";<br \/>\n$sh3=\"\";<br \/>\n$aic=\"Am I Correct?\";<br \/>\nif (isset($_GET['fortyeight'])) {<br \/>\n  $fortyeight=$_GET['fortyeight'];<br \/>\n  $fortyeighti=\"&lt;input type=hidden name=fortyeight value='\" . $fortyeight . \"'&gt;&lt;\/input&gt;\";<br \/>\n  $fortyeightj=\"&fortyeight=\" . $fortyeight;<br \/>\n  $aic=\"Correct?\";<br \/>\n  $ob=\" onblur=\\\" if (this.value.trim() != '') { document.getElementById('subm').click(); } \\\" \";<br \/>\n  $sh3=\" style='display:none;'\";<br \/>\n}<br \/>\n<br \/>\nif (isset($_GET['numplayers'])) {<br \/>\n  $preifs=\"&lt;html&gt;<br \/>\n&lt;head&gt;&lt;title&gt;What Is The English Word - RJM Programming - February, 2022&lt;\/title&gt;<br \/>\n&lt;\/head&gt;&lt;body style='background-color:yellow;'&gt;&lt;table style='width:100%;' border=20&gt;&lt;tr&gt;&lt;th colspan=2&gt;Player&lt;\/th&gt;&lt;\/tr&gt;&lt;tr&gt;&lt;th&gt;Number&lt;\/th&gt;&lt;th&gt;Game&lt;\/th&gt;&lt;\/tr&gt;&lt;\/table&gt;&lt;\/body&gt;&lt;\/html&gt;\";<br \/>\n  for ($ih=1; $ih&lt;=$_GET['numplayers']; $ih++) {<br \/>\n     $preifs=str_replace(\"&lt;\/table&gt;\", \"&lt;tr&gt;&lt;td style=text-align:center;&gt;\" . $ih . \"&lt;\/td&gt;&lt;td&gt;&lt;iframe src='.\/what_is_the_english_word.php?fortyeight=24' style='width:100%;height:200px;'&gt;&lt;\/iframe&gt;&lt;\/table&gt;\", $preifs);<br \/>\n  }<br \/>\n  echo $preifs;<br \/>\n  exit;<br \/>\n}<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p> &#8230; the idea of the &#8220;fortyeight&#8221; code is to reduce the font size in order to fit in more player iframe display into the one shared screen, with <font color=blue>the user interfacing code<\/font> being &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\n&lt;h3\" . $sh3 . \"&gt;RJM Programming <font color=blue>&lt;a title='How many players?' style='cursor:pointer;text-decoration:underline;' onclick=\\\" var hm=prompt('How many players?','1'); if (hm == null) { hm=''; } if (hm.trim().replace('1','') != '') { location.href=document.URL.split('?')[0].split('#')[0] + '?fortyeight=24&numplayers=' + encodeURIComponent(hm);  } \\\"&gt;<\/font>-<font color=blue>&lt;\/a&gt;<\/font> February, 2022&lt;\/h3&gt;<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; for <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php-GETME\" title=\"what_is_the_english_word.php\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php-GETME\" title=\"what_is_the_english_word.php\">what_is_the_english_word.php<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php\" title=\"Click picture\">English Word Guessing Game<\/a>.<\/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\/english-word-guessing-game-players-tutorial\/'>English Word Guessing Game Players Tutorial<\/a>.<\/p-->\n<hr>\n<p id='ewggpt'>Previous relevant <a target=_blank title='English Word Guessing Game Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/english-word-guessing-game-primer-tutorial\/'>English Word Guessing 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\/PHP\/what_is_the_english_word.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"English Word Guessing Game Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.jpg\" title=\"English Word Guessing Game Primer Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">English Word Guessing Game Primer Tutorial<\/p><\/div>\n<p>Ever so simple!  Is that what you want in a Word Game?   We like that, but we also like to learn words that might be new to us.  How about a &#8230;<\/p>\n<ul>\n<li>English word game &#8230;<\/li>\n<li>based on Linux or unix or macOS dictionary list &#8230;<\/li>\n<li>randomly choosing &#8230;\n<ol>\n<li>word length between 5 and 12<\/li>\n<li>a letter in word<\/li>\n<li>that letter position in word<\/li>\n<\/ol>\n<\/li>\n<li>and a clue, thanks to <a target=_blank title='Thanks' href='http:\/\/crossword-solver.io\/clue\/'>https:\/\/crossword-solver.io\/clue\/<\/a><\/li>\n<\/ul>\n<p> &#8230; basis for our word game, today?  Well, it&#8217;s just &#8220;first draft&#8221; time for <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php_GETME\" title=\"what_is_the_english_word.php\">what_is_the_english_word.php<\/a>&#8216;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/what_is_the_english_word.php\" title=\"Click picture\">English Word Guessing Game<\/a>, but we think you might like to try it?!<\/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='#d54888' onclick='var dv=document.getElementById(\"d54888\"); 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='d54888' 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='#d54918' onclick='var dv=document.getElementById(\"d54918\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/players\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54918' 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='#d54923' onclick='var dv=document.getElementById(\"d54923\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/hotkey\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d54923' 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 Players Tutorial started multi-player scenarios with our &#8220;English Word Guessing Game&#8221; web application, but was a bit &#8220;amateur hour&#8221; in its approach, regarding &#8230; premature, and too simple, (textbox) onblur event programmatical form submit button &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/english-word-guessing-game-player-equality-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":[326,388,448,476,573,587,1705,932,952,3908,997,1761,1022,1238,1319,1452,1453],"class_list":["post-54923","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-games","category-tutorials","tag-dictionary","tag-english","tag-focus","tag-game","tag-hotkey","tag-iframe","tag-onkeydown","tag-php","tag-player","tag-players","tag-programming","tag-prompt","tag-quiz","tag-table","tag-tutorial","tag-word","tag-word-game"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54923"}],"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=54923"}],"version-history":[{"count":5,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54923\/revisions"}],"predecessor-version":[{"id":54928,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/54923\/revisions\/54928"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=54923"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=54923"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=54923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}