{"id":6515,"date":"2014-02-24T05:04:51","date_gmt":"2014-02-23T18:04:51","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=6515"},"modified":"2014-02-24T05:04:51","modified_gmt":"2014-02-23T18:04:51","slug":"phpjavascript-decoding-scrambled-words-game-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/phpjavascript-decoding-scrambled-words-game-tutorial\/","title":{"rendered":"PHP\/Javascript Decoding Scrambled Words Game Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/DecodingScrambledWords\/\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"PHP Decoding Scrambled Words Game Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/DecodingScrambledWords\/DecodingScrambledWords.jpg\" title=\"PHP\/Javascript Decoding Scrambled Words Game Tutorial\"  \/><\/a><p class=\"wp-caption-text\">PHP\/Javascript Decoding Scrambled Words Game Tutorial<\/p><\/div>\n<p>Do you like word games?  Today&#8217;s game takes four randomly generated words, encodes them, and asks you to decode them &#8230; the words have 4 to 9 characters in them &#8230; mind you, out of them, you&#8217;d <a target=_blank title='Thanks to Google Translate' href='http:\/\/www.translate.google.com'>have<\/a> \u5947\u602a\u7684\u5b57\u7b26 or \u5909\u306a\u6587\u5b57 or \u0432\u0435\u0441\u0435\u043b\u044b\u0435 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0438 or \uc774\uc0c1\ud55c \ubb38\uc790 or \u0645\u0636\u062d\u06a9\u06c1 \u062e\u06cc\u0632 \u062d\u0631\u0648\u0641 or \u5947\u602a\u7684\u5b57\u7b26 or \u0905\u091c\u0940\u092c \u0905\u0915\u094d\u0937\u0930 or \u10e1\u10d0\u10e1\u10d0\u10ea\u10d8\u10da\u10dd \u10d2\u10db\u10d8\u10e0\u10d4\u10d1\u10d8 or \u178f\u17bd\u17a2\u1780\u17d2\u179f\u179a\u178a\u17c2\u179b\u1782\u17bd\u179a\u17b1\u17d2\u1799\u17a2\u179f\u17cb\u179f\u17c6\u178e\u17be\u1785 or \u0bb5\u0bc7\u0b9f\u0bbf\u0b95\u0bcd\u0b95\u0bc8 \u0b8e\u0bb4\u0bc1\u0ba4\u0bcd\u0ba4\u0bc1\u0b95\u0bcd\u0b95\u0bb3\u0bcd or \u0e15\u0e31\u0e27\u0e15\u0e25\u0e01 or \u0627\u0644\u0623\u062d\u0631\u0641 \u0645\u0636\u062d\u0643 or \u05de\u05d0\u05b8\u05d3\u05e0\u05e2 \u05d0\u05d5\u05ea\u05d9\u05d5\u05ea or \u0ab0\u0aae\u0ac2\u0a9c\u0ac0 \u0a85\u0a95\u0acd\u0ab7\u0ab0\u0acb or \u03b1\u03c3\u03c4\u03b5\u03af\u03bf\u03c5\u03c2 \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03ae\u03c1\u03b5\u03c2 or \u0ca4\u0cae\u0cbe\u0cb7\u0cc6\u0caf \u0caa\u0cbe\u0ca4\u0ccd\u0cb0\u0c97\u0cb3\u0cc1 or \u09ae\u099c\u09be\u09b0 \u0985\u0995\u09cd\u09b7\u09b0 or \u0ea5\u0eb1\u0e81\u0eaa\u0eb0\u0e99\u0eb0 funny or \u0432\u044f\u0441\u0451\u043b\u044b\u044f \u043f\u0435\u0440\u0441\u0430\u043d\u0430\u0436\u044b or \u0c39\u0c3e\u0c38\u0c4d\u0c2f \u0c05\u0c15\u0c4d\u0c37\u0c30\u0c3e\u0c32\u0c41  &#8230; we&#8217;re going to call the game <i>&#8220;Decoding Scrambled Words&#8221;<\/i> &#8230; and you score a point for each unscrambled set of words.  It uses English words, based on the dictionary arrangements at its (web) server.   Maybe it would be a good game to learn English vocabulary.<\/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, so to make it for another language, change the code inside the four file_get_contents() calls in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/DecodingScrambledWords\/decodewords.php_GETME\" title=\"decodewords.php\">decodewords.php<\/a><\/p>\n<p>This <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/DecodingScrambledWords\/\" title=\"Decoding Scrambled Words\">game<\/a> has two parts to it for PHP and Javascript to respectively get a word to use and arrange the user interaction.<\/p>\n<p>Hopefully you can figure the rules when you click the picture above for a <a target=_blank title=\"live run\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/DecodingScrambledWords\/\">live run<\/a>.<\/p>\n<p>Thank you to <a target=_blank title='The Free Dictionary' href='http:\/\/thefreedictionary.com'>The Free Dictionary<\/a> for its great online presence as a dictionary resource, for the functionality to optionally explain a word&#8217;s dictionary meaning.  The image map &#8220;click parts of the picture&#8221; <a target=_blank title='Pointed at vocabulary tutorials' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=vocabulary'>vocabulary ESL tutorials<\/a> at this blog use the same resource to explain dictionary information about clicked on &#8220;things&#8221;.<\/p>\n<p>Anyway, see how you go with this game of interest and history!<\/p>\n<p>Anyway, see how you go with this game of logic and tactics!<\/p>\n<p>Maybe a view of <a target=_blank title='Enigma' href='http:\/\/www.youtube.com\/watch?v=pQ1TZLmBm7M'>this<\/a> could inspire you?!<\/p>\n<p>Here is a link to some downloadable PHP (with Javascript) programming code you could rename to <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/DecodingScrambledWords\/decodewords.php_GETME\" title=\"decodewords.php\">decodewords.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='#d6515' onclick='var dv=document.getElementById(\"d6515\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?cat=44\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d6515' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Do you like word games? Today&#8217;s game takes four randomly generated words, encodes them, and asks you to decode them &#8230; the words have 4 to 9 characters in them &#8230; mind you, out of them, you&#8217;d have \u5947\u602a\u7684\u5b57\u7b26 or &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/phpjavascript-decoding-scrambled-words-game-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":[221,477,576,652,932,997,1319,1454],"class_list":["post-6515","post","type-post","status-publish","format-standard","hentry","category-elearning","category-esl","category-games","category-tutorials","tag-codebreaking","tag-games-2","tag-html","tag-javascript","tag-php","tag-programming","tag-tutorial","tag-word-games"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/6515"}],"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=6515"}],"version-history":[{"count":0,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/6515\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=6515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=6515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=6515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}