{"id":36778,"date":"2018-03-14T03:01:21","date_gmt":"2018-03-13T17:01:21","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=36778"},"modified":"2018-03-14T06:13:19","modified_gmt":"2018-03-13T20:13:19","slug":"knockout-dice-game-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/knockout-dice-game-primer-tutorial\/","title":{"rendered":"Knockout Dice Game Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/knockout_dice_game.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Knockout Dice Game Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/knockout_dice_game.jpg\" title=\"New Dice Guessing Game Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Knockout Dice Game Primer Tutorial<\/p><\/div>\n<p>Further to the previous <a title='Dice Guessing Game Primer Tutorial' href='#dggpt'>Dice Guessing Game Primer Tutorial<\/a>, today, we have for you another Dice Game, this time &#8230;<\/p>\n<ul>\n<li>a dice game for 2 to 9 players &#8230; which you should establish, as necessary, straight up &#8230;<\/li>\n<li>then rename any player names you don&#8217;t want to be the default <i>Player1<\/i> up to <i>Player9<\/i> values, again, making use of 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 and the HTML div element&#8217;s <i>onchange<\/i> event to achieve this<\/li>\n<li>then in each round of competition the players choose a two dice roll value between 6 to 9 as the value they don&#8217;t want to see turn up, because if it does, they score nothing for that round of competition, else the players last not rejected when there is one or no players left, score a point in that round of competition &#8230; and &#8230;<\/li>\n<li>the web application randomly throws the dice the necessary number of times to find winner(s) once the &#8220;Roll the Dice for Each Player&#8221; button is pressed<\/li>\n<\/ul>\n<p>We&#8217;d like to thank the <a target=_blank title='Useful webpage, thanks' href='https:\/\/icebreakerideas.com\/dice-games\/#Knock_Out_Dice_Game_for_Kids'>very useful webpage<\/a> for ideas for how (for the most part) this Knockout Dice Game design, execution and rules should go.<\/p>\n<p>And again, we&#8217;d welcome your <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/knockout_dice_game.html\" title=\"Click picture\">try out<\/a> of this new Knockout Dice Guessing Game, and please feel free to tell us what you think.  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\/knockout_dice_game.html_GETME\" title=\"knockout_dice_game.html\">knockout_dice_game.html<\/a> link.<\/p>\n<hr>\n<p id='dggpt'>Previous relevant <a target=_blank title='Dice Guessing Game Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/dice-guessing-game-primer-tutorial\/'>Dice Guessing Game 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\/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>You can also see this play out at WordPress 4.1.1&#8217;s <a target=_blank title='Dice Guessing Game Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/dice-guessing-game-primer-tutorial\/'>Dice Guessing Game Primer Tutorial<\/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='#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<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='#d36778' onclick='var dv=document.getElementById(\"d36778\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/game\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d36778' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Further to the previous Dice Guessing Game Primer Tutorial, today, we have for you another Dice Game, this time &#8230; a dice game for 2 to 9 players &#8230; which you should establish, as necessary, straight up &#8230; then rename &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/knockout-dice-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-36778","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\/36778"}],"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=36778"}],"version-history":[{"count":4,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/36778\/revisions"}],"predecessor-version":[{"id":36808,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/36778\/revisions\/36808"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=36778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=36778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=36778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}