{"id":36761,"date":"2018-03-13T03:01:30","date_gmt":"2018-03-12T17:01:30","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=36761"},"modified":"2018-03-13T05:48:33","modified_gmt":"2018-03-12T19:48:33","slug":"dice-guessing-game-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/dice-guessing-game-primer-tutorial\/","title":{"rendered":"Dice Guessing Game Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/dice_game.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Dice Guessing Game Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/dice_game.jpg\" title=\"Dice Guessing Game Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Dice Guessing Game Primer Tutorial<\/p><\/div>\n<p>There are many <a target=_blank title='HTML Entities based on punctuation' href='https:\/\/www.w3schools.com\/charsets\/ref_utf_punctuation.asp'>HTML Entities based around punctuation<\/a> that can add to the means by which you communicate ideas with your web applications.<\/p>\n<p>In today&#8217;s new (up to two player) Dice Game, we use some of these to represent the numbers from 1 to 6 on the faces of the dice, similar to how you may have seen this happen with dice in various games you play, or hanging from your car&#8217;s front visor perhaps?<\/p>\n<p>We&#8217;d welcome your <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/dice_game.html\" title=\"Click picture\">try out<\/a> of this Dice Guessing Game, and feel free to tell us what you think (or if its two of you &#8220;tell us what you think&#8221; &#8230; huh?!).  Its HTML and Javascript and CSS underpinning its functionality can be perused by downloading the <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/dice_game.html_GETME\" title=\"dice_game.html\">dice_game.html<\/a> link.  If you do, you&#8217;ll see the mildly interesting scoring system, that can be explained via the equation &#8230;<\/p>\n<p><code><br \/>\n[CorrectAnswerScoreIncrement] = (7 - [NumberOfPossibilitiesInFull36PossibilitiesSet])<br \/>\n<\/code><\/p>\n<p> &#8230; allowing for the incorporation of this Javascript array initialization &#8230;<\/p>\n<p><code><br \/>\nvar probabilities=[0,0,1,2,3,4,5,6,5,4,3,2,1];  \/\/ score will be 7-guessValue<br \/>\n<\/code><\/p>\n<p> &#8230; that we were capable of working out ourselves but were reassured by the mathematics of this <a target=_blank title='Useful link' href='HTTP:\/\/www.math.hawaii.edu\/~ramsey\/Probability\/TwoDice.html'>very useful link<\/a>, thanks.<\/p>\n<p>Another game thought unique to how we do things that has been introduced today, is that a user can change the default player names, those being <i>Player1<\/i> and <i>Player2<\/i> via an HTML div element utilizing the <a target=_blank title='HTML Global attribute contenteditable information from w3schools' href='https:\/\/www.w3schools.com\/tags\/att_global_contenteditable.asp'>contenteditable<\/a>=&#8221;true&#8221; global HTML attribute to make it look readable, but be also &#8220;quietly&#8221; editable.<\/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='#d36761' onclick='var dv=document.getElementById(\"d36761\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/tutorial\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d36761' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>There are many HTML Entities based around punctuation that can add to the means by which you communicate ideas with your web applications. In today&#8217;s new (up to two player) Dice Game, we use some of these to represent the &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/dice-guessing-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,15,37],"tags":[103,2442,281,2501,342,476,477,576,577,652,752,989,997,2502,1319],"class_list":["post-36761","post","type-post","status-publish","format-standard","hentry","category-elearning","category-games","category-tutorials","tag-array","tag-contenteditable","tag-css","tag-dice","tag-div","tag-game","tag-games-2","tag-html","tag-html-entities","tag-javascript","tag-mathematics","tag-probability","tag-programming","tag-punctuation","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/36761"}],"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=36761"}],"version-history":[{"count":7,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/36761\/revisions"}],"predecessor-version":[{"id":36789,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/36761\/revisions\/36789"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=36761"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=36761"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=36761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}