{"id":52719,"date":"2021-07-15T03:01:41","date_gmt":"2021-07-14T17:01:41","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=52719"},"modified":"2021-07-15T06:54:14","modified_gmt":"2021-07-14T20:54:14","slug":"htmljavascript-binaryoctalhexadecimal-game-buttons-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/htmljavascript-binaryoctalhexadecimal-game-buttons-tutorial\/","title":{"rendered":"HTML\/Javascript Binary\/Octal\/Hexadecimal Game Buttons Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/binary_quiz.htm\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"HTML\/Javascript Binary\/Octal\/Hexadecimal Game Buttons Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/binary_quiz_buttons.jpg\" title=\"HTML\/Javascript Binary\/Octal\/Hexadecimal Game Buttons Tutorial\" \/><\/a><p class=\"wp-caption-text\">HTML\/Javascript Binary\/Octal\/Hexadecimal Game Buttons Tutorial<\/p><\/div>\n<p>When you think about a makeover to a web application involving user interactive input, you could do a lot worse than concentrating on additional HTML (for us, input type=) button elements.  Just about everybody understands the concept of a &#8220;button press&#8221; means &#8220;action&#8221;.   In that way, if the way the rest of the web application confuses, buttons often break through that confusion.<\/p>\n<p>And so, in this context, we had occasion to revisit the game web application of <a title='HTML\/Javascript Binary\/Octal\/Hexadecimal Game Tutorial' href='#html\/jb\/o\/hgt'>HTML\/Javascript Binary\/Octal\/Hexadecimal Game Tutorial<\/a> written way back in December 2014, and felt that confusion we&#8217;d summarize (in &#8220;weakness terms&#8221;) as &#8230;<\/p>\n<blockquote><p>\nNot enough reward for effort.\n<\/p><\/blockquote>\n<p> &#8230; it panning out that &#8220;the reward&#8221; was an offer to &#8220;replay&#8221; the Binary\/Octal\/Hexadecimal Game for another go where you improve on the time it took you to solve the five questions, correctly, in the previous game.<\/p>\n<p>On this &#8220;small makeover&#8221; we decided not to &#8220;roll over&#8221; on these lofty sparse rewards, as we think the effort here will help understanding, but the introduction of buttons helps create interest &#8220;on the trip&#8221; of the game, we think.<\/p>\n<p>The game has five questions of two types &#8230;<\/p>\n<ol>\n<li>known decimal number for a set of known and unknown dropdown (ie. select) element digit of base 2 (binary) or 8 (octal) or 16 (hexidecimal) numbers<\/li>\n<li>unknown decimal number for a set of known dropdown (ie. select) element digit of base 2 (binary) or 8 (octal) or 16 (hexidecimal) numbers<\/li>\n<\/ol>\n<p> &#8230; and the five corresponding buttons act to, respectively &#8230;<\/p>\n<ol>\n<li>offer a question mark button the pressing of which uses a Javascript prompt window to prompt for the user&#8217;s decimal number guess<\/li>\n<li>fill in result (HTML div) with a cross emoji for incorrect and tick emoji for correct correspondence<\/li>\n<\/ol>\n<p> &#8230; resulting, we think, in the sense that there is a feeling of progression within the set of five questions, along the way.  That is what we think, but perhaps you have your own opinion about <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/binary_quiz.html-GETME\" title='binary_quiz.htm'>this changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/binary_quiz.html-GETME\" title='binary_quiz.htm'>binary_quiz.htm<\/a> HTML and Javascript <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/binary_quiz.htm\" title=\"Click picture\">numbers game<\/a> &#8230;<\/p>\n<p><iframe src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/binary_quiz.htm\" style=\"width:100%;height:400px;\"><\/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-binaryoctalhexadecimal-game-tutorial\/'>HTML\/Javascript Binary\/Octal\/Hexadecimal Game Buttons Tutorial<\/a>.<\/p-->\n<hr>\n<p id='html\/jb\/o\/hgt'>Previous relevant <a target=_blank title='HTML\/Javascript Binary\/Octal\/Hexadecimal Game Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/html\/javascript-binary\/octal\/hexadecimal-game-tutorial\/'>HTML\/Javascript Binary\/Octal\/Hexadecimal 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\/HTMLCSS\/binary_quiz.html\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"HTML\/Javascript Binary\/Octal\/Hexadecimal Game Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/binary_quiz.jpg\" title=\"HTML\/Javascript Binary\/Octal\/Hexadecimal Game Tutorial\" id='ibq' onmouseover=' this.src=this.src.replace(\".jpg\",\".PNG\").replace(\".png\",\".jpg\").replace(\".PNG\",\".png\");   '  \/><\/a><p class=\"wp-caption-text\">HTML\/Javascript Binary\/Octal\/Hexadecimal Game Tutorial<\/p><\/div>\n<p>Are you feeling transformational?  Maybe calculating?   Perhaps didactic?   Witheringly logical?   You can test how you feel, in a mathematical sense, by playing our &#8220;Binary\/Octal\/Hexadecimal&#8221; <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/binary_quiz.html\" title=\"Binary\/Octal\/Hexadecimal game\">game<\/a> today.<\/p>\n<p>The study of <a target=_blank title='Radix information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Radix'>bases<\/a> other than (decimal) 10 in mathematics is very interesting and it is used a lot in computing, a simple example of which is notation like #ffffff to describe the colour white, which lots of us were taught at school as the colour that contains the lot, hence all the 255 (hexadecimal ff) of Red and 255 (hexadecimal ff) of Green and 255 (hexadecimal ff) of Blue in the <a target=_blank title='RGB information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/RGB_color_model'>RGB colour model<\/a> system.  You might think that a computer would be able to work faster with the smaller amounts of data of hexadecimal, but, basically, the computer will, eventually, go and turn this into binary because at the bottom of its design it understands <i>on<\/i> and <i>off<\/i>, as you would understand voltage on a Bugs Bunny cartoon if you were the Coyote just missing the Roadrunner, running into an electrical socket running an Eat at Joes sign being switched off, on (sizzle), off, on (sizzle), off, on (sizzled <a target=_blank title='Coyote' href='http:\/\/www.google.com.au\/imgres?imgurl=https%3A%2F%2Fi1.ytimg.com%2Fvi%2Fmtxe-vnyJms%2Fhqdefault.jpg&#038;imgrefurl=http%3A%2F%2Fwww.word.photos%2Findex.php%3Fkeyword%3Da%2520road%2520runner%2520cartoon&#038;h=360&#038;w=480&#038;tbnid=sPjKIjMu08ibPM%3A&#038;zoom=1&#038;docid=TJ4gSBsKEGhmtM&#038;ei=BK2WVKb2CeHUmAXGoYHIAQ&#038;tbm=isch&#038;iact=rc&#038;uact=3&#038;dur=765&#038;page=1&#038;start=0&#038;ndsp=15&#038;ved=0CB4QMygBMAE'>Coyote<\/a>, meet <a target=_blank title='Daffy Duck' href='https:\/\/www.google.com.au\/search?q=daffy+duck+electrocuted+bugs+bunny&#038;biw=1280&#038;bih=622&#038;source=lnms&#038;tbm=isch&#038;sa=X&#038;ei=_KiWVLOOMIKwmwW9t4FI&#038;ved=0CAYQ_AUoAQ#tbm=isch&#038;q=%22daffy+duck+burnt%22&#038;facrc=_&#038;imgdii=_&#038;imgrc=5k8RuB5Gi-9jXM%253A%3Bvcv6zZqt_rMiGM%3Bhttp%253A%252F%252Fi.ytimg.com%252Fvi%252F0b1_9czUox4%252Fhqdefault.jpg%3Bhttp%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253D0b1_9czUox4%3B480%3B360'>Daffy Duck<\/a>?!).<\/p>\n<p>Anyway, see how you go with this game that asks you to solve 5 problems as quickly as possible.  One way around you can cheat the system, and this is fine by me, in the sense that the intention is just to put that picture in your head of the powers of 2 involved to get a little bit familiar with them.   Another way to do this is to access a text editor that can simultaneously display a hexadecimal view (or dump) of that data.  <a target=_blank title='UltraEdit Windows text editor' href='http:\/\/www.ultraedit.com\/ultraedit-tour\/hex-editor.html'>UltraEdit<\/a> on Windows can do this.<\/p>\n<p>Here is a link to some downloadable HTML (with Javascript) programming code you could rename to <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/binary_quiz.html_GETME\" title=\"binary_quiz.html\">binary_quiz.html<\/a> and a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/binary_quiz.html\" title=\"Live Run\">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='#d11158' onclick='var dv=document.getElementById(\"d11158\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=game\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d11158' 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='#d52719' onclick='var dv=document.getElementById(\"d52719\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/button\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d52719' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>When you think about a makeover to a web application involving user interactive input, you could do a lot worse than concentrating on additional HTML (for us, input type=) button elements. Just about everybody understands the concept of a &#8220;button &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/htmljavascript-binaryoctalhexadecimal-game-buttons-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":[174,3706,308,385,476,477,3704,3703,3705,861,997,1319],"class_list":["post-52719","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-games","category-tutorials","tag-button","tag-buttons","tag-decimal","tag-emoji","tag-game","tag-games-2","tag-hexidecimal","tag-number-game","tag-octal","tag-onclick","tag-programming","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/52719"}],"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=52719"}],"version-history":[{"count":8,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/52719\/revisions"}],"predecessor-version":[{"id":52727,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/52719\/revisions\/52727"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=52719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=52719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=52719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}