{"id":73752,"date":"2026-07-06T03:01:00","date_gmt":"2026-07-05T17:01:00","guid":{"rendered":"https:\/\/www.rjmprogramming.com.au\/ITblog\/?p=73752"},"modified":"2026-07-05T18:10:47","modified_gmt":"2026-07-05T08:10:47","slug":"pairings-game-makeover-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/pairings-game-makeover-tutorial\/","title":{"rendered":"Pairings Game Makeover Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/pairings_game.html\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Pairings Game Makeover Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/pairings_game_makeover.jpg\" title=\"Pairings Game Makeover Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">Pairings Game Makeover Tutorial<\/p><\/div>\n<p>We often find that the &#8220;second draft&#8221; of a web application that represents a game or quiz can be a rewarding experience.  The &#8220;first draft&#8221; of such web applications is often a &#8220;scurrying to represent those initial ideas before they are forgotten exercise&#8221;.<\/p>\n<p>But a &#8220;second draft&#8221; can be done under less pressure, where ideas to extend the initial premise of the game or quiz, come far easier on revisiting and retesting.  In that way, <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/pairings_game.html-GETME\" rel=\"noopener\">we extended<\/a> into a <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/pairings_game.html-GETME\" rel=\"noopener\">&#8220;second draft&#8221;<\/a> quite a few tinkerings &#8230;<\/p>\n<ul>\n<li>make number of table cells a select<sup>able<\/sup> setting (within reason)<\/li>\n<li>make number of components within each synergy set a select<sup>able<\/sup> setting (within reason)<\/li>\n<li>allow the user to add their own remember<sup>able<\/sup> synergy set(s)<\/li>\n<li>allow the user to share their own remember<sup>able<\/sup> synergy set(s) with an email or SMS recipient<\/li>\n<li>add emoji tick or cross to score to indicate answer correctness<\/li>\n<li>add seconds elapsed for those competitive players<\/li>\n<\/ul>\n<p> &#8230; that, though minor by nature, and &#8220;optional&#8221;, of course, yet, can make the project, we had as of the day before yesterday&#8217;s <a title='Pairings Game Tutorial' href='#pgt'>Pairings Game Tutorial<\/a>, far more interesting, we feel.<\/p>\n<p>You can try the <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/pairings_game.html\" rel=\"noopener\">Pairings<sup>++<\/sup> Game<\/a> <a href='#pgif'>below<\/a>, if you like.<\/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\/pairings-game-makeover-tutorial\/' rel=\"noopener\">Pairings Game Makeover Tutorial<\/a>.<\/p-->\n<hr>\n<p id='pgt'>Previous relevant <a target=\"_blank\" title='Pairings Game Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/pairings-game-tutorial\/' rel=\"noopener\">Pairings 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\/pairings_game.html\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Pairings Game Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/pairings_game.jpg\" title=\"Pairings Game Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">Pairings Game Tutorial<\/p><\/div>\n<p>In this programming world, it is comforting to think of the &#8220;pairings&#8221; that go on.  But it&#8217;s everywhere, the comfort a &#8220;pairing&#8221; can represent for people.<\/p>\n<p>With this in mind, we designed a simple game &#8230;<\/p>\n<ul>\n<li>the player is presented with 5 ideas of a &#8220;pairing&#8221; &#8230; it&#8217;s subjective, but &#8230;<\/li>\n<li>we believe only one of these will score you a point by clicking on<\/li>\n<\/ul>\n<p> &#8230; in this <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/pairings_game.html_GETME\" rel=\"noopener\">first draft<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/pairings_game.html\" rel=\"noopener\">Pairings Game<\/a> whose tabular cell innards consist of 5 buttons and 5 <a target=\"_blank\" title='Overlay postings' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/overlay' rel=\"noopener\">overlay<\/a>ing &#8230;<\/p>\n<p><code><br \/>\n   var rectos=[];<br \/>\n<br \/>\n   function prepopulate() { \/\/ called at document.body onload<br \/>\n      for (var icell=0; icell&lt;5; icell++) {<br \/>\n       rectos.push(document.getElementById('td' + eval(1 + icell)).getBoundingClientRect());<br \/>\n      }<br \/>\n   }<br \/>\n   <br \/>\n   function populate() {  \/\/ called whenever question changes<br \/>\n     var fivebuts=[], fiveoverlays=[];<br \/>\n     var makecorrect=Math.floor(Math.random() * 5), recto=null;<br \/>\n     var interestg=-1, tg=-1;<br \/>\n     sofarb=',';<br \/>\n     sofaro=',';<br \/>\n     <br \/>\n     for (var icell=0; icell&lt;5; icell++) {<br \/>\n       recto=rectos[icell]; \/\/document.getElementById('td' + eval(1 + icell)).getBoundingClientRect();<br \/>\n       interestg=Math.floor(Math.random() * eval('' + pairingsa.length));<br \/>\n       if (makecorrect == icell) {<br \/>\n         while ((sofarb + sofaro).indexOf(',' + interestg + ',') != -1) {<br \/>\n           interestg=Math.floor(Math.random() * eval('' + pairingsa.length));<br \/>\n         }<br \/>\n         fivebuts.push(interestg);<br \/>\n         fiveoverlays.push(interestg);<br \/>\n         sofarb+='' + interestg + ',';<br \/>\n         sofaro+='' + interestg + ',';<br \/>\n         if (eval(Math.floor(Math.random() * 19876754) % 2) == 0) {<br \/>\n         document.getElementById('td' + eval(1 + icell)).innerHTML='&lt;button onclick=scoreit(1);&gt;' + pairingsa[interestg].split('&')[1] + '&lt;\/button&gt;&lt;div style=\"margin-left:10px;margin-top:10px;font-size:24px;position:absolute;top:' + ('' + recto.top).split('.')[0] + 'px;' + 'left:' + ('' + recto.left).split('.')[0] + 'px;width:' + ('' + recto.width).split('.')[0] + 'px;height:' + ('' + recto.height).split('.')[0] + 'px;z-index:2345;opacity:0.6;pointer-events:none;\"&gt;' + pairingsa[interestg].split('&')[0] + '&lt;\/div&gt;';<br \/>\n         } else {<br \/>\n         document.getElementById('td' + eval(1 + icell)).innerHTML='&lt;button onclick=scoreit(1);&gt;' + pairingsa[interestg].split('&')[0] + '&lt;\/button&gt;&lt;div style=\"margin-left:10px;margin-top:10px;font-size:24px;position:absolute;top:' + ('' + recto.top).split('.')[0] + 'px;' + 'left:' + ('' + recto.left).split('.')[0] + 'px;width:' + ('' + recto.width).split('.')[0] + 'px;height:' + ('' + recto.height).split('.')[0] + 'px;z-index:2345;opacity:0.6;pointer-events:none;\"&gt;' + pairingsa[interestg].split('&')[1] + '&lt;\/div&gt;';<br \/>\n         }<br \/>\n       } else {<br \/>\n         while (sofarb.indexOf(',' + interestg + ',') != -1) {<br \/>\n           interestg=Math.floor(Math.random() * eval('' + pairingsa.length));<br \/>\n         }<br \/>\n         sofarb+='' + interestg + ',';<br \/>\n         tg=interestg;<br \/>\n         interestg=Math.floor(Math.random() * eval('' + pairingsa.length));<br \/>\n         while ((sofarb + sofaro).indexOf(',' + interestg + ',') != -1 || tg == interestg) {<br \/>\n           interestg=Math.floor(Math.random() * eval('' + pairingsa.length));<br \/>\n         }<br \/>\n         sofaro+='' + interestg + ',';<br \/>\n         if (eval(Math.floor(Math.random() * 19876754) % 2) == 0) {<br \/>\n         document.getElementById('td' + eval(1 + icell)).innerHTML='&lt;button onclick=scoreit(0);&gt;' + pairingsa[interestg].split('&')[1] + '&lt;\/button&gt;&lt;div style=\"margin-left:10px;margin-top:10px;font-size:24px;position:absolute;top:' + ('' + recto.top).split('.')[0] + 'px;' + 'left:' + ('' + recto.left).split('.')[0] + 'px;width:' + ('' + recto.width).split('.')[0] + 'px;height:' + ('' + recto.height).split('.')[0] + 'px;z-index:2345;opacity:0.6;pointer-events:none;\"&gt;' + pairingsa[tg].split('&')[0] + '&lt;\/div&gt;';<br \/>\n         } else {<br \/>\n         document.getElementById('td' + eval(1 + icell)).innerHTML='&lt;button onclick=scoreit(0);&gt;' + pairingsa[tg].split('&')[0] + '&lt;\/button&gt;&lt;div style=\"margin-left:10px;margin-top:10px;font-size:24px;position:absolute;top:' + ('' + recto.top).split('.')[0] + 'px;' + 'left:' + ('' + recto.left).split('.')[0] + 'px;width:' + ('' + recto.width).split('.')[0] + 'px;height:' + ('' + recto.height).split('.')[0] + 'px;z-index:2345;opacity:0.6;pointer-events:none;\"&gt;' + pairingsa[interestg].split('&')[1] + '&lt;\/div&gt;';<br \/>\n         }<br \/>\n       }<br \/>\n     }<br \/>\n<br \/> <br \/>\n   }<br \/>\n<\/code><\/p>\n<p> &#8230; div elements (<font size=1>optionally<\/font> we&#8217;ve decided to apply <a target=\"_blank\" title='CSS pointer-events information from W3schools' href='https:\/\/www.w3schools.com\/cssref\/css3_pr_pointer-events.php' rel=\"noopener\"><i>pointer-events:none;<\/i><\/a> to, per game question.<\/p>\n<p>Pretty, simple, huh?!<\/p>\n<p><iframe id=pgif style=\"width:100%;height:900px;\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/pairings_game.html\"><\/iframe><\/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='#d73731' onclick='var dv=document.getElementById(\"d73731\"); 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='d73731' 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='#d73762' onclick='var dv=document.getElementById(\"d73762\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/select\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d73762' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We often find that the &#8220;second draft&#8221; of a web application that represents a game or quiz can be a rewarding experience. The &#8220;first draft&#8221; of such web applications is often a &#8220;scurrying to represent those initial ideas before they &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/pairings-game-makeover-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":[5570,5569,5568,1683,380,1797,476,3362,576,652,2415,2999,2910,5146,5430,997,5298,1866,2766,1159,1319,3551],"class_list":["post-73752","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-games","category-tutorials","tag-compete","tag-competition","tag-duo","tag-dynamic","tag-email","tag-extension","tag-game","tag-hardcoding","tag-html","tag-javascript","tag-localstorage","tag-optional","tag-pair","tag-pairing","tag-pairings","tag-programming","tag-remember","tag-select","tag-setting","tag-sms","tag-tutorial","tag-window-localstorage"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/73752"}],"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=73752"}],"version-history":[{"count":5,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/73752\/revisions"}],"predecessor-version":[{"id":73757,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/73752\/revisions\/73757"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=73752"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=73752"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=73752"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}