<html>
<head>
<title>Pairings Game - RJM Programming - Jujy, 2026</title>
<meta charset="UTF-8" />
<style>
button { height: 280px; width:95%; background-color: yellow; font-size:24px; overflow-wrap: anywhere; }
div { overflow-wrap: anywhere; color: blue; }
</style>
<script type=text/javascript>

// Use pointer-events: none;

var secselapsed=-1;
var dimension=location.search.split('dimension=')[1] ? eval('' + location.search.split('dimension=')[1].split('&')[0]) : 2;
var sstor='', isl=false, emailee='', smsee='', origsmsurl='', origemailurl='', asmsurl='', aemailurl='';
var five=location.search.split('cells=')[1] ? eval('' + location.search.split('cells=')[1].split('&')[0]) : 5;
var trbit='<tr></tr>';
var shareurl='';
var moreadd=location.search.split('add=')[1] ? decodeURIComponent('' + location.search.split('add=')[1].split('&')[0]) : '';

var sofarb=',', sofaro=',';
var pairingsa=['Fred&Ginger', '&Simon&Garfunkel', 'Torvill&Dean', 'dog&bone', 'Saturday&Sunday', 'Japan&Tokyo', 'cookies&cream', 'Laurel&Hardy', 'Daffy&Donald', 'chalk&cheese', 'Juan Carlos Copes&MarĂ­a Nieves', 'hope&chastity', 'paint&brush', 'cup&saucer', 'top&bottom', 'left&right', 'law&order', 'salt&pepper', 'ebony&ivory', 'Tristan&Isolde', 'Antony&Cleopatra', 'Serena&Venus', 'Morecambe&Wise', 'Hall&Oates', 'PHP&Javascript', 'Bonny&Clyde', 'Butch Cassidy&The Sundance Kid', 'black&white', 'earth&moon', 'iPhone&Mac', 'knit&purl', 'addition&subtraction', 'clairvoyance&telepathy', 'socket&wrench', 'man&woman', 'song&tune', 'sunset&sunrise'];
var triosa=['Peter&Paul&Mary', 'Neil Armstrong&Buzz Aldrin&Michael Collins', 'Lucky Day&Dusty Bottoms&Ned Nederlander', 'Kurt Cobain&Krist Novoselic&Dave Grohl', 'Sting&Andy Summers&Stewart Copeland', 'equilateral&scalene&isosceles', 'steam&water&ice', 'land&sea&air'];
var quartetsa=['Bob&Carol&Ted&Alice', 'John&Paul&George&Ringo', 'Leonardo&Raphael&Donatello&Michelangelo', 'Frodo&Sam&Merry&Pippin', 'Venkman&Spengler&Stantz&Zeddemore', 'Ron Burgundy&Brian Fantana&Brick Tamland&Champ Kind', 'Micky Dolenz&Davy Jones&Michael Nesmith&Peter Tork'];
var quintetsa=['George&Julian&Dick&Anne&Timmy', 'Emily Murphy&Henrietta Muir Edwards&Nellie McClung&Louise Crummy McKinney&Irene Parlby', 'Mel B&Melanie C&Emma Bunton&Geri Halliwell&Victoria Beckham', 'Genesis&Exodus&Leviticus&Numbers&Deuteronomy', 'Keith&Laurie&Danny&Chris&Tracy', 'Huron&Ontario&Michigan&Erie&Superior', 'Jackie&Tito&Jermaine&Marlon&Michael', 'Mick&Keith&Brian&Bill&Charlie', 'Homer&Marge&Bart&Lisa&Maggie'];
var sextetsa=['France&Ireland&England&Wales&Scotland&Italy', 'Monica&Rachel&Phoebe&Ross&Chandler&Joey', 'Iron Man&Captain America&Thor&Hulk&Black Widow&Hawkeye', 'Twilight Sparkle&Applejack&Rainbow Dash&Rarity&Fluttershy&Pinkie Pie', 'Catherine of Aragon&Anne Boleyn&Jane Seymour&Anne of Cleves&Catherine Howard&Catherine Parr', 'up&down&charm&strange&top&bottom'];
var score=0, goes=0, rectos=[];

function scoreit(thisinc) {
goes++;
score+=thisinc;
if (eval('' + thisinc) > 0) {
document.getElementById('hscore').innerHTML='Score ✅ ' + score + '/' + goes + ' ... seconds so far <span id=ssecs>' + secselapsed + '</span>';
} else {
document.getElementById('hscore').innerHTML='Score ❌ ' + score + '/' + goes + ' ... seconds so far <span id=ssecs>' + secselapsed + '</span>';
}
populate();
}


function applyforce(inu) {
alert(inu);
return inu;
}

function dimize(pz) {
if (eval('' + dimension) > 2 && eval('' + dimension) <= 6) {
switch(eval('' + dimension)) {
case 3:
pz=pz.replace('&', String.fromCharCode(32) + '<br>');
break;

case 4:
pz=pz.replace('&' + pz.split('&')[2] + '&' + pz.split('&')[3], '#@#' + pz.split('&')[2] + '&' + pz.split('&')[3]);
pz=pz.replace(/\&/g, String.fromCharCode(32) + '<br>');
break;

case 5:
pz=pz.replace('&' + pz.split('&')[2] + '&' + pz.split('&')[3] + '&' + pz.split('&')[4], '#@#' + pz.split('&')[2] + '&' + pz.split('&')[3] + '&' + pz.split('&')[4]);
pz=pz.replace(/\&/g, String.fromCharCode(32) + '<br>');
break;

case 6:
pz=pz.replace('&' + pz.split('&')[3] + '&' + pz.split('&')[4] + '&' + pz.split('&')[5], '#@#' + pz.split('&')[3] + '&' + pz.split('&')[4] + '&' + pz.split('&')[5]);
pz=pz.replace(/\&/g, String.fromCharCode(32) + '<br>');
break;

default:
break;
}
}
return '' + pz.replace(/\#\@\#/g,'&');
}

function prepopulate() {
if (eval('' + dimension) > 2 && eval('' + dimension) <= 6) {
switch(eval('' + dimension)) {
case 3:
pairingsa=triosa;
document.getElementById('gword').innerHTML='Trios';
break;

case 4:
pairingsa=quartetsa;
document.getElementById('gword').innerHTML='Quartets';
break;

case 5:
pairingsa=quintetsa;
document.getElementById('gword').innerHTML='Quintets';
break;

case 6:
pairingsa=sextetsa;
document.getElementById('gword').innerHTML='Sextets';
break;

default:
break;
}
}
for (var icell=0; icell<five; icell++) {
rectos.push(document.getElementById('td' + eval(1 + icell)).getBoundingClientRect());
}
if (moreadd.trim() != '') { anal(moreadd); moreadd=''; }
}

function anal(inpv) {
if (inpv.trim() != '') {
if (sstor.trim() != '' || 5 == 5) {
if ((sstor + '"').substring(0,1) == '"') {
sstor+=',' + inpv.trim().replace(/^\,/g,'').replace(/^\'/g,'"').replace(/\'$/g,'"').replace(/\'\ \,\ \'/g, '","').replace(/\'\,\ \'/g, '","').replace(/\'\ \,\'/g, '","').replace(/\'\,\'/g, '","');
} else if (sstor.substring(0,1) == "'") {
sstor+=',' + inpv.trim().replace(/^\,/g,'').replace(/^\"/g,"'").replace(/\"$/g,"'").replace(/\"\ \,\ \"/g, "','").replace(/\"\,\ \"/g, "','").replace(/\"\ \,\"/g, "','").replace(/\"\,\"/g, "','");
} else {
sstor+=',' + inpv.trim().replace(/^\,/g,'').replace(/^\"/g,"").replace(/\"$/g,"").replace(/\'\ \,\ \'/g, ",").replace(/\'\,\ \'/g, ",").replace(/\'\ \,\'/g, ",").replace(/\"\ \,\ \"/g, ",").replace(/\"\,\ \"/g, ",").replace(/\"\ \,\"/g, ",").replace(/\"\,\"/g, ",").replace(/\'\,\'/g, ",");
}
}
if (sstor.trim() != '' && inpv.trim() != inpv) {
window.localStorage.setItem('pairings_game_pairings', encodeURIComponent(sstor.replace(/^\,/g,'')));
isl=true;
populate();
} else if (sstor.trim() != '' && !isl) {
window.sessionStorage.setItem('pairings_game_pairings', encodeURIComponent(sstor.replace(/^\,/g,'')));
populate();
} else if (sstor.trim() != '') {
window.localStorage.setItem('pairings_game_pairings', encodeURIComponent(sstor.replace(/^\,/g,'')));
isl=true;
populate();
}
if (isl) {
shareurl=document.URL.split('?')[0].split('#')[0] + '?add=' + encodeURIComponent(sstor.trim() + ' ');
} else {
shareurl=document.URL.split('?')[0].split('#')[0] + '?add=' + encodeURIComponent(sstor.trim());
}
document.getElementById('aemail').href=document.getElementById('aemail').href.split('body=')[0] + 'body=' + encodeURIComponent(shareurl);
document.getElementById('asms').href=document.getElementById('asms').href.split('body=')[0] + 'body=' + encodeURIComponent(shareurl);
}
}

function populate() {
var pairingsai='', pairingsaj='';
var adds=[];
var fivebuts=[], fiveoverlays=[];
var makecorrect=Math.floor(Math.random() * five), recto=null, interim='';
var interestg=-1, tg=-1;
sofarb=',';
sofaro=',';

sstor=decodeURIComponent(('' + window.sessionStorage.getItem('pairings_game_pairings')).replace(/^null/g,'').replace(/^undefined/g,'')).replace(/^\,/g,'').replace(/\'\ \,\ \'/g, "','").replace(/\'\,\ \'/g, "','").replace(/\'\ \,\'/g, "','").replace(/\"\ \,\ \"/g, '","').replace(/\"\,\ \"/g, '","').replace(/\"\ \,\"/g, '","');
if (sstor.trim() == '') {
sstor=decodeURIComponent(('' + window.localStorage.getItem('pairings_game_pairings')).replace(/^null/g,'').replace(/^undefined/g,'')).replace(/^\,/g,'').replace(/\'\ \,\ \'/g, "','").replace(/\'\,\ \'/g, "','").replace(/\'\ \,\'/g, "','").replace(/\"\ \,\ \"/g, '","').replace(/\"\,\ \"/g, '","').replace(/\"\ \,\"/g, '","');
if (sstor.trim() != '') {
isl=true;
if (sstor.substring(0,1) == '"') {
adds=sstor.replace(/^\"/g,'').replace(/\"$/g,'').split('","');
} else if (sstor.substring(0,1) == "'") {
adds=sstor.replace(/^\'/g,'').replace(/\'$/g,'').split("','");
} else {
adds=sstor.split(",");
}
}
} else {
if (sstor.substring(0,1) == '"') {
adds=sstor.replace(/^\"/g,'').replace(/\"$/g,'').split('","');
} else if (sstor.substring(0,1) == "'") {
adds=sstor.replace(/^\'/g,'').replace(/\'$/g,'').split("','");
} else {
adds=sstor.split(",");
}
}

if (sstor.trim() != '') {
document.getElementById('myshare').style.display='inline-block';
document.getElementById('aemail').style.display='inline-block';
document.getElementById('asms').style.display='inline-block';
if (isl) {
shareurl=document.URL.split('?')[0].split('#')[0] + '?add=' + encodeURIComponent(sstor.trim() + ' ');
} else {
shareurl=document.URL.split('?')[0].split('#')[0] + '?add=' + encodeURIComponent(sstor.trim());
}
document.getElementById('aemail').href=document.getElementById('aemail').href.split('body=')[0] + 'body=' + encodeURIComponent(shareurl);
document.getElementById('asms').href=document.getElementById('asms').href.split('body=')[0] + 'body=' + encodeURIComponent(shareurl);
}

for (var kcell=0; kcell<adds.length; kcell++) {
if (adds[kcell].indexOf('&') > 0) {
if (eval('' + adds[kcell].split('&').length) == dimension) {
pairingsa.push(adds[kcell]);
}
} else if (interim == '') {
interim=adds[kcell];
} else {
if (eval('' + (interim + '&' + adds[kcell]).split('&').length) == dimension) {
pairingsa.push(interim + '&' + adds[kcell]);
interim='';
} else if (eval('' + (interim + '&' + adds[kcell]).split('&').length) < dimension) {
interim+='&' + adds[kcell];
}
}
}

if (eval(2 * eval('' + five)) > eval(1 * eval('' + pairingsa.length))) {
five=Math.floor(eval(0.5 * eval('' + pairingsa.length)));
//alert('here' + five);
location.href='./pairings_game.html?cells=' + five + '&dimension=' + dimension;
//} else {
// alert('herex' + five + ' vs ' + eval('' + pairingsa.length) + ' and (sofarb + sofaro)=' + (sofarb + sofaro));
}

for (var icell=0; icell<five; icell++) {
recto=rectos[icell]; //document.getElementById('td' + eval(1 + icell)).getBoundingClientRect();
interestg=Math.floor(Math.random() * eval('' + pairingsa.length));
if (makecorrect == icell) {
while ((sofarb + sofaro).indexOf(',' + interestg + ',') != -1) {
interestg=Math.floor(Math.random() * eval('' + pairingsa.length));
//alert('Herex' + five + ' vs ' + eval('' + pairingsa.length) + ' and (sofarb + sofaro)=' + (sofarb + sofaro) + ' Vs interestg=' + interestg);
}
pairingsai=dimize('' + pairingsa[interestg]);
fivebuts.push(interestg);
fiveoverlays.push(interestg);
sofarb+=',' + interestg + ',';
sofaro+=',' + interestg + ',';
if (eval(Math.floor(Math.random() * 19876754) % 2) == 0) {
document.getElementById('td' + eval(1 + icell)).innerHTML='<button onclick=scoreit(1);>' + pairingsai.split('&')[1] + '</button><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;">' + pairingsai.split('&')[0] + '</div>';
} else {
document.getElementById('td' + eval(1 + icell)).innerHTML='<button onclick=scoreit(1);>' + pairingsai.split('&')[0] + '</button><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;">' + pairingsai.split('&')[1] + '</div>';
}
} else {
while (sofarb.indexOf(',' + interestg + ',') != -1) {
interestg=Math.floor(Math.random() * eval('' + pairingsa.length));
//alert('HeREx' + five + ' vs ' + eval('' + pairingsa.length) + ' and (sofarb)=' + (sofarb + '') + ' Vs inTerRestg=' + interestg);
}
sofarb+=',' + interestg + ',';
tg=interestg;
pairingsaj=dimize('' + '' + pairingsa[tg]);
interestg=Math.floor(Math.random() * eval('' + pairingsa.length));
while ((sofarb + sofaro).indexOf(',' + interestg + ',') != -1 || tg == interestg) {
interestg=Math.floor(Math.random() * eval('' + pairingsa.length));
//alert('HeRex' + five + ' vs ' + eval('' + pairingsa.length) + ' and (sofarb + sofaro)=' + (sofarb + sofaro) + ' Vs interRestg=' + interestg);
}
pairingsai=dimize('' + pairingsa[interestg]);
sofaro+=',' + interestg + ',';
if (eval(Math.floor(Math.random() * 19876754) % 2) == 0) {
document.getElementById('td' + eval(1 + icell)).innerHTML='<button onclick=scoreit(0);>' + pairingsai.split('&')[1] + '</button><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;">' + pairingsaj.split('&')[0] + '</div>';
} else {
document.getElementById('td' + eval(1 + icell)).innerHTML='<button onclick=scoreit(0);>' + pairingsaj.split('&')[0] + '</button><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;">' + pairingsai.split('&')[1] + '</div>';
}
}
}

if (secselapsed < 0) {
secelapsed=0;
setInterval(secel, 1000);
}
}

function secel() {
secselapsed++;
if (document.getElementById('ssecs')) {
document.getElementById('ssecs').innerHTML='' + secselapsed;
}
}

</script>
</head>
<body onload=" setTimeout(prepopulate, 2000); setTimeout(populate, 5000);">
<h1><span id=gword>Pairings</span> Game</h1>
<h3>RJM Programming - July, 2026 <font size=1 id=myshare title='Share your Pairings with a recipient.' style=display:none;>    <a target=_blank onmouseover="if (emailee.length == 0 && origemailurl.indexOf('mailto:?') != -1) { emailee=prompt('Please enter Email address to send to.', ''); if (emailee == null) { emailee=''; } else { origemailurl=origemailurl.replace('mailto:?','mailto:' + emailee + '?'); aemailurl=origemailurl.replace('mailto:?','mailto:' + emailee + '?'); this.href=applyforce(aemailurl); } }" ontouchstart="if (emailee.length == 0 && origemailurl.indexOf('mailto:?') != -1) { emailee=prompt('Please enter Email address to send to.', ''); if (emailee == null) { emailee=''; } else { origemailurl=origemailurl.replace('mailto:?','mailto:' + emailee + '?'); aemailurl=origemailurl.replace('mailto:?','mailto:' + emailee + '?'); this.href=applyforce(aemailurl); } }" href='mailto:?subject=Pairings%20Game&body=' id=aemail title=Email>📧</a>    <a target=_blank onmouseover="if (smsee.length == 0 && origsmsurl.indexOf('sms:&') != -1) { smsee=prompt('Please enter SMS number to send to.', ''); if (smsee == null) { smsee=''; } else { origsmsurl=origsmsurl.replace('sms:&','sms:' + smsee + '&'); asmsurl=origsmsurl.replace('sms:&','sms:' + smsee + '&'); this.href=applyforce(asmsurl); } }" ontouchstart="if (smsee.length == 0 && origsmsurl.indexOf('sms:&') != -1) { smsee=prompt('Please enter SMS number to send to.', ''); if (smsee == null) { smsee=''; } else { origsmsurl=origsmsurl.replace('sms:&','sms:' + smsee + '&'); asmsurl=origsmsurl.replace('sms:&','sms:' + smsee + '&'); this.href=applyforce(asmsurl); } }" href='sms:&body=' id=asms title=SMS>📟</a></font></h3>

<h4 id=hscore>Score: 0/0 ... Pick the one button with the best pairing to score using <select onchange="location.href='./pairings_game.html?cells=' + this.value + '&dimension=' + dimension;"><option id=optoe value="">5</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="8">8</option><option value="10">10</option><option value="12">12</option><option value="15">15</option></select> cells for groups of <select onchange="location.href='./pairings_game.html?dimension=' + this.value + '&cells=' + five;"><option id=optoed value="">2</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option></select> which could consist of <input onblur=anal(this.value); type=text placeholder="some of your own, appending a space to remember? ( eg. 'Mona&Lisa','gold&silver' )" style=display:inline-block;width:38%;></input></h4>

<table style=width:97%;height:400px; border=4>
<script type=text/javascript>
if (five == 5) {
setTimeout(function(){ document.getElementById('optoe').innerHTML='' + five; }, 4000);
setTimeout(function(){ document.getElementById('optoed').innerHTML='' + dimension; }, 4000);
document.write("<tr><td id=td1 style=width:20%;vertical-align:top;></td><td id=td2 style=width:20%;vertical-align:top;></td><td id=td3 style=width:20%;vertical-align:top;></td><td id=td4 style=width:20%;vertical-align:top;></td><td id=td5 style=width:20%;vertical-align:top;></td></tr>");
} else {
trbit='<tr></tr>';
setTimeout(function(){ document.getElementById('optoe').innerHTML='' + five; }, 4000);
setTimeout(function(){ document.getElementById('optoed').innerHTML='' + dimension; }, 4000);
for (var iu=1; iu<=five; iu++) {
trbit=trbit.replace('</tr>', '<td id=td' + iu + ' style=width:' + eval(100.0 / five) + '%;vertical-align:top;></td></tr>');
}
document.write(trbit);
}
</script>
</table>

</body>
</html>