{"id":13132,"date":"2015-03-04T05:01:50","date_gmt":"2015-03-03T18:01:50","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=13132"},"modified":"2015-03-04T05:01:50","modified_gmt":"2015-03-03T18:01:50","slug":"php-target-word-game-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-target-word-game-primer-tutorial\/","title":{"rendered":"PHP Target Word Game Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/target_share_challenge.php\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"PHP Target Word Game Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/target_share_challenge.jpg\" title=\"PHP Target Word Game Primer Tutorial\"    \/><\/a><p class=\"wp-caption-text\">PHP Target Word Game Primer Tutorial<\/p><\/div>\n<p>Meanwhile, back at the <i>&#8220;word-games-trying-to-assist-ESL-students&#8221;<\/i> ranch &#8230;<\/p>\n<blockquote><p><i>&#8220;Targ\u00e9t!  Darn it Targ\u00e9t, where are ya?  There&#8217;s chores to be done, Targ\u00e9t.  Tar&#8217;ggggg\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9tttttt!&#8221;<\/i><\/p>\n<p><i>&#8220;Paw, did you come a calling, with an unsilent &#8216;t&#8217; &#8230; when youse knows full well, Paw &#8230; that them thar &#8216;t&#8217; is awful quiet when preceeded by a &#8216;\u00e9&#8217; Paw, like?&#8221;<\/i><\/p>\n<p><i>&#8220;Son, think youse&#8217;ll find a &#8216;\u00e9&#8217; aint nearly so goodly as an &#8216;\u00e9&#8217;, son.&#8221;<\/i><\/p>\n<p><i>&#8220;Y&#8217;know Paw, sometimes ar dunno git what youse on about, &#8216;specially regarding &#8216;t&#8217; and &#8216;\u00e9&#8217; &#8230; tho yo not bad at &#8216;b&#8217; &#8216;n &#8216;g&#8217; &#8230; but who aint?  Ever since we&#8217;all changed my name to Targ\u00e9t you been acting kinda strang\u00e9 &#8230; and when ar say strang\u00e9, ar mean strang\u00e9 &#8230; aint that strang\u00e9?&#8221;<\/i><\/p>\n<p><i>&#8220;Strang\u00e9 aint the word for it, Targ\u00e9t.  You just git busy providing that there word games on youse up yonder on ESL Ranch ridge, and never mind what your Pappy&#8217;s views on &#8216;t&#8217; and &#8216;\u00e9&#8217; are, y&#8217;hear.&#8221;<\/i><\/p>\n<p><i>&#8220;&#8216;Fraid am bit short of h\u00e9aring th\u00e9r\u00e9, Paw &#8230; but how &#8217;bout w\u00e9 ch\u00e9ck the rain m\u00e9t\u00e9r on that, next time on yonder ridg\u00e9?&#8221;<\/i><\/p><\/blockquote>\n<p>Some word and sentence games are not so good for <a target=_blank title='ESL informatiuon from Wikipedia' href='http:\/\/en.wikipedia.org\/wiki\/English_as_a_second_or_foreign_language'>ESL<\/a> students, such as our previous <a target=_blank title='PHP Rhopalic Letter Sentence Game Mobile Friendly Tutorial' href='#prlsgmft'>PHP Rhopalic Letter Sentence Game Mobile Friendly Tutorial<\/a> as shown below, perhaps, because the vocabulary resulting can be a bit far-fetched at times, so, today, the word game is a bit more traditional, and only calls on vocabulary the user already knows, and, hopefully, gets them recalling, or thinking about.<\/p>\n<p>Today&#8217;s word game we&#8217;re calling <i>&#8220;Target Share Challenge&#8221;<\/i> and it is largely based around a quiz game called &#8220;Target&#8221; presented in <a target=_blank title='Target in SMH' href='http:\/\/www.smh.com.au'>The Sydney Morning Herald<\/a> newspaper, except that we add email (snapshot) functionality and leave behind functionality saying what a good score would be.  So that is the idea of a challenge, with snapshots of the game possible to challenge your friends and\/or (ESL) classmates.   What follows are examples of the email link types &#8230;<\/p>\n<ul>\n<li><a target=_blank title=\"Target Share Challenge ... New Game\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/target_share_challenge.php\">Invitation to Play New Game<\/a><\/li>\n<li><a target=_blank title=\"Target Share Challenge ... New Game\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/target_share_challenge.php?l1=A&#038;l2=L&#038;l3=U&#038;l4=T&#038;l5=E&#038;l6=N&#038;l7=E&#038;l8=C&#038;l9=R\">Invitation to Play New Game with Designated Letters<\/a><\/li>\n<li><a target=_blank title=\"Target Share Challenge ... New Game\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/target_share_challenge.php?l1=A&#038;l2=L&#038;l3=U&#038;l4=T&#038;l5=E&#038;l6=N&#038;l7=E&#038;l8=C&#038;l9=R&#038;wordlist=lucre%3Blectern%3Bnature%3Brule%3Brecent%3Bcentral%3Bcretan%3Btureen%3Bacer%3Bcanter%3Bantler%3Burea%3Btare%3Bneal%3Btern%3Bneer%3Bcent%3Brace%3Blure%3Bcute%3Brectal%3Benter%3Bcure%3Btreacle%3Bacre%3Balen%3Bunreal%3Bcareen%3Btrance%3Bante%3Bearn%3Blearn%3Bcaret%3Balter%3Bcruel%3Buncle%3Blune%3Btrace%3Bteal%3Btuner%3Btune%3Bclean%3Bcrane%3Blane%3Bnectar%3Btree%3Bneuter%3Bteen%3Blean%3Bclear%3Btear%3Blear%3Bcrate%3Brate%3Blate%3Btale%3Blearnt%3Breal%3Belance%3Blance%3Bcreate%3Bneat%3Bnacre%3Blancet%3Bclaret%3Bcare%3Bearl%3Brent%3Bcruet%3Bcleat%3Bleer%3Btrue%3Btane%3Btruce%3Btenure%3Blent%3Bcelt%3Bluce%3Brane%3Benact%3Brenal%3Blecture%3Btenure\">Invitation to Play Game Building On or Collaborating Regarding a Word List<\/a> &#8230; cannot get 9 letter word &#8230; please <a href='mailto:rmetcalfe15@gmail.com?subject=Help%20...%20Nine%20letter%20word%20you%20are%20after%20for%20link%20below%20is%20...%20...%20Target%20Share%20Challenge&#038;cc=rmetcalfe@rjmprogramming.com.au&#038;body=Nine%20letter%20word%20you%20are%20after%20for%20link%20below%20is%20...%20...%20%0A%0D%0A%0Dhttp%3A%2F%2Fwww.rjmprogramming.com.au%2FPHP%2Ftarget_share_challenge.php%3Fl1%3DA%26l2%3DL%26l3%3DU%26l4%3DT%26l5%3DE%26l6%3DN%26l7%3DE%26l8%3DC%26l9%3DR%26wordlist%3Dlucre%3Blectern%3Bnature%3Brule%3Brecent%3Bcentral%3Bcretan%3Btureen%3Bacer%3Bcanter%3Bantler%3Burea%3Btare%3Bneal%3Btern%3Bneer%3Bcent%3Brace%3Blure%3Bcute%3Brectal%3Benter%3Bcure%3Btreacle%3Bacre%3Balen%3Bunreal%3Bcareen%3Btrance%3Bante%3Bearn%3Blearn%3Bcaret%3Balter%3Bcruel%3Buncle%3Blune%3Btrace%3Bteal%3Btuner%3Btune%3Bclean%3Bcrane%3Blane%3Bnectar%3Btree%3Bneuter%3Bteen%3Blean%3Bclear%3Btear%3Blear%3Bcrate%3Brate%3Blate%3Btale%3Blearnt%3Breal%3Belance%3Blance%3Bcreate%3Bneat%3Bnacre%3Blancet%3Bclaret%3Bcare%3Bearl%3Brent%3Bcruet%3Bcleat%3Bleer%3Btrue%3Btane%3Btruce%3Btenure%3Blent%3Bcelt%3Bluce%3Brane%3Benact%3Brenal%3Blecture%3Btenure'>help<\/a><\/li>\n<\/ul>\n<p>Today&#8217;s game tests your vocabulary skills in English.  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\/PHP\/target_share_challenge.php\" title='Click picture'>live run<\/a> and here is the PHP programming source code you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/target_share_challenge.php_GETME\" title=\"target_share_challenge.php\">target_share_challenge.php<\/a><\/p>\n<hr \/>\n<p id='prlsgmft'>Previous relevant <a target=_blank title='PHP Rhopalic Letter Sentence Game Mobile Friendly Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=12145'>PHP Rhopalic Letter Sentence Game Mobile Friendly 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\/rhopalic_letter_sentence.php\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"PHP Rhopalic Letter Sentence Game Mobile Friendly Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/rhopalic_letter_sentence.gif\" title=\"PHP Rhopalic Letter Sentence Game Mobile Friendly Tutorial\"    \/><\/a><p class=\"wp-caption-text\">PHP Rhopalic Letter Sentence Game Mobile Friendly Tutorial<\/p><\/div>\n<p>To make a web application more mobile device friendly, there is the look and the usability to consider.  When you consider the look you should try to take into account, very small device widths, as would be applicable for a lot of smartphones.  As far as usability goes, one thing we&#8217;ve found is that keyboard entry is less friendly than for your laptop, or desktop computer.<\/p>\n<p>This is a huge topic area, but put the spotlight on a tutorial web application from a few days back to see some of the issues &#8230; do you remember <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=12084'>PHP Rhopalic Letter Sentence Game Primer Tutorial<\/a>?  As a first look through for mobile friendliness, we touched on &#8230;<\/p>\n<ul>\n<li>add functionality so that the choice is there for less keyboard initializing taking place &#8230; if all keyboard can happen in one or two places that is better than for lots of textbox places, on mobile devices<\/li>\n<li>make <i>input type=&#8221;text&#8221;<\/i> tiny bit wider<\/li>\n<li>if down the track you think this will be the innards of a WebView of a mobile application, stop any navigation that takes you to another webpage, else accompany any WebView with <i>&#8220;back&#8221;<\/i> and <i>&#8220;forward&#8221;<\/i> buttons (whose functionality is most likely neatly encapsulated by easy measures you can take within the IDE you are using)<\/li>\n<li>use a PHP <a target=_blank title='PHP mail function' href='http:\/\/php.net\/manual\/en\/function.mail.php'>mail<\/a> (server-side) method of emailing rather than using an HTML <i>a<\/i> tag <a target=_blank title='mailto information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tryit.asp?filename=tryhtml_link_mailto'><i>mailto:<\/i><\/a> <a target=_blank title='HTML a tag information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_a.asp'><i>href<\/i><\/a> value (client-side method, that relies on an email client program) &#8230; this is only an issue, if down the line, this may become the innards of a WebView in a mobile application<\/li>\n<li>at the client (and this is perhaps the better, but not the only (ie. if PHP server-side is involved, <a target=_blank title='Some PHP research and development ideas regarding mobile device detection could start here ... thanks' href='http:\/\/stackoverflow.com\/questions\/4117555\/simplest-way-to-detect-a-mobile-device'>it can be done there too<\/a>, but not the same way &#8230; doh!), place to test for it), with Javascript, use a test like &#8230;<br \/>\n<code><br \/>\nif (navigator.userAgent.match(\/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile\/i)) {<br \/>\n  \/\/ it is a mobile device<br \/>\n}<br \/>\n<\/code><br \/>\n &#8230; great thanks to this <a target=_blank title='Great cross-platform advice' href='http:\/\/www.abeautifulsite.net\/detecting-mobile-devices-with-javascript\/'>link<\/a> for this advice and idea\n<\/li>\n<li>use meta tag like &#8230;<br \/>\n<code><br \/>\n&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=yes\" \/&gt;<br \/>\n<\/code><br \/>\n&#8230; between &lt;head&gt; and &lt;\/head&gt; &#8230; as you can imagine, there are huge variations in requirements here, and if you want a start at some more R&#038;D, have a read of a Firefox  (after all, this is a cross-browser, as well as cross-platform, issue) <a target=_blank title='Firefox take (after all, this is a cross-browser, as well as cross-platform, issue) on viewport meta tag regarding mobile devices' href='https:\/\/developer.mozilla.org\/en\/docs\/Mozilla\/Mobile\/Viewport_meta_tag'>webpage<\/a> talking about the viewport meta tag regarding mobile devices<\/li>\n<\/ul>\n<p>&#8230; to, hopefully, improve it as a mobile web application, and hopefully, as a web application generally.<\/p>\n<p>Please tee up a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/rhopalic_letter_sentence.php\" title='Click picture'>live run<\/a> with the PHP programming source code <a target=_blank  download=\"rhopalic_letter_sentence.php\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/rhopalic_letter_sentence.php-GETME\" title='rhopalic_letter_sentence.php'>rhopalic_letter_sentence.php<\/a> (changed from a few days ago, to make it more mobile friendly, as per <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/rhopalic_letter_sentence.php-GETME\" title='rhopalic_letter_sentence.php'>rhopalic_letter_sentence.php<\/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='#d12145' onclick='var dv=document.getElementById(\"d12145\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=mobile-friendly\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d12145' 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='#d13132' onclick='var dv=document.getElementById(\"d13132\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=esl\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d13132' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Meanwhile, back at the &#8220;word-games-trying-to-assist-ESL-students&#8221; ranch &#8230; &#8220;Targ\u00e9t! Darn it Targ\u00e9t, where are ya? There&#8217;s chores to be done, Targ\u00e9t. Tar&#8217;ggggg\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9\u00e9tttttt!&#8221; &#8220;Paw, did you come a calling, with an unsilent &#8216;t&#8217; &#8230; when youse knows full well, Paw &#8230; that &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-target-word-game-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,13,15,37],"tags":[326,396,476,477,652,707,798,932,997,1319,1453],"class_list":["post-13132","post","type-post","status-publish","format-standard","hentry","category-elearning","category-esl","category-games","category-tutorials","tag-dictionary","tag-esl","tag-game","tag-games-2","tag-javascript","tag-linux","tag-mobile-friendly","tag-php","tag-programming","tag-tutorial","tag-word-game"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/13132"}],"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=13132"}],"version-history":[{"count":0,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/13132\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=13132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=13132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=13132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}