{"id":36912,"date":"2018-03-20T03:01:46","date_gmt":"2018-03-19T17:01:46","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=36912"},"modified":"2018-03-21T09:31:22","modified_gmt":"2018-03-20T23:31:22","slug":"first-name-guessing-game-for-two-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/first-name-guessing-game-for-two-primer-tutorial\/","title":{"rendered":"First Name Guessing Game for Two Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/nameguessgame.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"First Name Guessing Game for Two Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/nameguessgame.jpg\" title=\"First Name Guessing Game for Two Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">First Name Guessing Game for Two Primer Tutorial<\/p><\/div>\n<p>It may not be immediately imaginable what would be the synergies between today&#8217;s proposed &#8220;First Name Guessing Game for Two&#8221; and <a title='Word Guessing Game for Two Primer Tutorial' href='#wggtpt'>Word Guessing Game for Two Primer Tutorial<\/a>&#8216;s &#8220;Word Guessing Game for Two&#8221;.  Other than that a First Name is a Word, isn&#8217;t there too much difference here to clone the &#8220;Word Guessing Game for Two&#8221; into a new &#8220;First Name Guessing Game for Two&#8221; when even dictionaries usually do not venture into the world of First Names, so much a product of our culture and history?  But, believe it or not these two games are so alike that, apart from tweaks to prompt wordings and message wordings, all that is needed to succeed after the cloning is to make the middle<strike>man<\/strike>person surprise.php get called for Linux (or Mac OS X FreeBSD) dictionary file usage such that instead of accessing a dictionary file called &#8230;<\/p>\n<p><code><br \/>\n\/usr\/share\/dict\/words<br \/>\n<\/code><\/p>\n<p> &#8230; that contains a list of singular, in our case, English, words to access, for the purposes of our new &#8220;First Name Guessing Game for Two&#8221; the dictionary file &#8230;<\/p>\n<p><code><br \/>\n\/usr\/share\/dict\/propernames<br \/>\n<\/code><\/p>\n<p> &#8230; cute,huh?!  But a big ask for a complete list of First Names around the world!  Nevertheless, it is good to have this list for our game today, and some other ideas that you can think of, am sure.  Maybe, a basis in letters for part of a password idea, for example.  Seeing this same dictionary file on both Mac OS X and Linux was an encouraging sign of support from the operating systems here.<\/p>\n<p>The event and organizational side of the web application is just as described for <a title='Word Guessing Game for Two Primer Tutorial' href='#wggtpt'>Word Guessing Game for Two Primer Tutorial<\/a> below.  We just call surprise.php with an extra &#8230;<\/p>\n<p><code><br \/>\n&amp;firstname=y<br \/>\n<\/code><\/p>\n<p> &#8230; within its URL.  Also, references to the online <a target=_blank href=\"http:\/\/www.thefreedictionary.com\/\">English<\/a> dictionary become a bit inapplicable, but we substitute in, here, on these <i>a<\/i> links, use of the excellent <a target=_blank title='Behind the Name' href='http:\/\/www.behindthename.com\/'>Behind the Name<\/a> website, thanks.<\/p>\n<p>So here&#8217;s a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/nameguessgame.html\" title='Click picture'>live run<\/a> and here is the HTML programming source code you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/nameguessgame.html-GETME\" title=\"nameguessgame.html\">nameguessgame.html<\/a> which <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/nameguessgame.html-GETME\" title=\"nameguessgame.html\">got created via these cloning changes<\/a>.<\/p>\n<p>You can also see this play out at WordPress 4.1.1&#8217;s <a target=_blank  href='https:\/\/www.rjmprogramming.com.au\/ITblog\/first-name-guessing-game-for-two-primer-tutorial\/'>First Name Guessing Game for Two Primer Tutorial<\/a>.<\/p>\n<hr>\n<p id='wggtpt'>Previous relevant <a target=_blank title='Word Guessing Game for Two Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/word-guessing-game-for-two-primer-tutorial\/'>Word Guessing Game for Two 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\/wordguessgame.html\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Word Guessing Game for Two Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wordguessgame.jpg\" title=\"Word Guessing Game for Two Primer Tutorial\" \/><\/a><p class=\"wp-caption-text\">Word Guessing Game for Two Primer Tutorial<\/p><\/div>\n<p>Word Games help vocabulary for <a target=_blank title='English as a second or foreign language' href='https:\/\/en.wikipedia.org\/wiki\/English_as_a_second_or_foreign_language'>ESL<\/a> students.  There is also not much doubt that collaboration can help ESL students, who also learn quicker with other students present.<\/p>\n<p>Today we create a web application Word Guessing Game designed for two.  Not two devices, the one device for two users (hovering over it).  So for &#8230;<\/p>\n<ul>\n<li>non-mobile users can play the game with one user using the mouse and the other using the keyboard<\/li>\n<li>mobile users can play with one user using touch on the blue areas of the web application and the other using touch on other places<\/li>\n<\/ul>\n<p>The events we code for are &#8230;<\/p>\n<ul>\n<li><a target=_blank title='Javascript onclick event information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/event_onclick.asp'>onclick<\/a>  &#8230; will be recognised on non-mobile platforms<\/li>\n<li><a target=_blank title='Javascript ontouchstart event information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/dom_obj_event.asp'>ontouchstart<\/a>  &#8230; will be recognised on mobile platforms (where it will supercede any onlick event)<\/li>\n<li><a target=_blank title='Javascript onkeyup event information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/event_onkeyup.asp'>onkeyup<\/a> &#8230;  will be recognised on non-mobile platforms<\/li>\n<\/ul>\n<p> &#8230; so you can see that the colour coding of the webpage becomes important for the mobile platform usage.<\/p>\n<p>Today&#8217;s game tests English vocabulary skills.  Why just English?   Well, it uses English words, based on the dictionary arrangements at its (web) server, which happens to be based on English.<\/p>\n<p>Programmers often use <a target_blank title='Words (unix) information from Wikipedia' href='http:\/\/en.wikipedia.org\/wiki\/Words_%28Unix%29'>Linux dictionary files<\/a> as a means to get a word list, and that list could be in any language, and for ours it is English.<\/p>\n<p>Here&#8217;s a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wordguessgame.html\" title='Click picture'>live run<\/a> and here is the HTML programming source code you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/wordguessgame.html_GETME\" title=\"wordguessgame.html\">wordguessgame.html<\/a> which, again, uses some PHP we&#8217;ve talked about with a lot of our <a target=_blank title='Word Games' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/word-game'>word games<\/a> at this blog, on a &#8220;Client Pre-Emptive Iframe&#8221; scenario in a couple of HTML iframe elements we include into today&#8217;s game.  We thank this free online <a target=_blank href=\"http:\/\/www.thefreedictionary.com\/\">English<\/a> dictionary that gets called on if the user chooses to.<\/p>\n<p>We hope you try it, and like it.  By the way, you can also play the game as a single user.<\/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='#d17485' onclick='var dv=document.getElementById(\"d17485\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=SQL\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d17485' 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='#d36912' onclick='var dv=document.getElementById(\"d36912\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/linux\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d36912' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>It may not be immediately imaginable what would be the synergies between today&#8217;s proposed &#8220;First Name Guessing Game for Two&#8221; and Word Guessing Game for Two Primer Tutorial&#8216;s &#8220;Word Guessing Game for Two&#8221;. Other than that a First Name is &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/first-name-guessing-game-for-two-primer-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,15,37],"tags":[2503,2509,326,2508,476,576,652,707,725,932,997,1319,1452,1453],"class_list":["post-36912","post","type-post","status-publish","format-standard","hentry","category-elearning","category-games","category-tutorials","tag-clone","tag-cloning","tag-dictionary","tag-first-name","tag-game","tag-html","tag-javascript","tag-linux","tag-mac-os-x","tag-php","tag-programming","tag-tutorial","tag-word","tag-word-game"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/36912"}],"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=36912"}],"version-history":[{"count":4,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/36912\/revisions"}],"predecessor-version":[{"id":36943,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/36912\/revisions\/36943"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=36912"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=36912"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=36912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}