<!doctype html>
<html>
<title>Emoji in Sector Game - RJM Programming - August, 2021 Thanks to https://www.iemoji.com</title>
<meta charset="utf-8"/>
<meta id="myviewport" name="viewport" content="width=device-width, initial-scale=1, minimum-scale=0.1, maximum-scale=8, user-scalable=yes">
<style>
p {
font-size: 94px;
text-align: center;
}
.kb {
background-color: yellow;
}
.peach::after {
content: '\01f351';
}
.eggplant::after {
content: '\01f346';
}
.tangerine::after {
content: '\01f34a';
}
.strawberry::after {
content: '\01f353';
}
.pineapple::after {
content: '\01f34d';
}
.watermelon::after {
content: '\01f349';
}
.grapes::after {
content: '\01f347';
}
.banana::after {
content: '\01f34c';
}
.cherries::after {
content: '\01f352';
}
.red_apple::after {
content: '\01f34e';
}
.lemon::after {
content: '\01f34b';
}
.green_apple::after {
content: '\01f34f';
}
.pear::after {
content: '\01f350';
}
.hot_pepper::after {
content: '\01f336';
}
.tomato::after {
content: '\01f345';
}
.melon::after {
content: '\01f348';
}
</style>
<script type='text/javascript'>
var wwt=0; //window.innerHeight
var obr=false;
var lastxx='';
var curkb=1;
var myt=null, myz=null; //table, first th
var thetds=[], thetdareas=[], thetdids=[];
var theclasses=[], thels=[], thets=[];
var thegridtdareas=[], thegridtdihs=[];
var numplayers=1;
var scores=['0'];
var goes=['0'];
var players=['Player 1'];
var answers=[''];
var classes=['peach', 'eggplant', 'tangerine', 'strawberry', 'pineapple', 'watermelon', 'grapes', 'banana', 'cherries', 'red_apple', 'lemon', 'green_apple', 'pear', 'hot_pepper', 'tomato', 'melon'];
var contents=['127825', '127814', '127818', '127827', '127821', '127817', '127815', '127820', '127826', '127822', '127819', '127823', '127824', '127798', '127813', '127816'];
var analnono=false;
var br='';
var ddd='... ';
function nanalyze(iois) {
var ij=eval(iois.id.replace('c',''));
players[ij]='' + iois.innerHTML;
}
function izeroanalyze() {
analyze(document.getElementById('i0'));
}
function analyze(iois) {
if (!analnono && iois.value != '') {
document.title+=' x';
var ij=eval(iois.id.replace('i',''));
goes[ij]='' + eval(eval('' + goes[ij]) + 1);
if (iois.value.toLowerCase().replace(/_/g,' ').replace('aubergine', 'eggplant').replace('grapes', 'grapX').replace('grape', 'grapes').replace('grapX', 'grapes').replace('cherry', 'cherries') == answers[ij]) {
scores[ij]='' + eval(eval('' + scores[ij]) + 2);
} else if ((answers[ij] + '~').indexOf(' ' + iois.value.toLowerCase().replace(/_/g,' ') + '~') != -1) {
scores[ij]='' + eval(eval('' + scores[ij]) + 1);
} else {
scores[ij]='' + Math.max(0, eval(-1 + eval('' + scores[ij])));
}
document.getElementById('sp' + ij).innerHTML='' + scores[ij] + '/' + goes[ij];
iois.value='';
another();
}
analnono=false;
}
function precontinuallook() {
if (top.document) {
if (top.document.getElementById('divac')) {
br='<br>';
ddd=' ';
document.getElementById('mytable').border='1';
document.getElementById('estyle').innerHTML="<style> p { font-size: 24px; text-align: center; } </style>";
continuallylook();
}
}
}
function continuallylook() {
var xx='';
if (top.document) {
if (top.document.getElementById('divac')) {
if (top.document.title.split(' ... ').length == 3) {
xx=top.document.title.split(' ... ')[1];
top.document.title=top.document.title.replace(' ... ' + xx, '');
}
if (xx.toLowerCase().indexOf('one ') != -1) {
document.getElementById('i0').value=xx.toLowerCase().split('one ')[1];
analyze(document.getElementById('i0'));
} else if (xx.toLowerCase().indexOf('two ') != -1) {
document.getElementById('i1').value=xx.toLowerCase().split('two ')[1];
analyze(document.getElementById('i1'));
} else if (xx.toLowerCase().indexOf('to ') != -1) {
document.getElementById('i1').value=xx.toLowerCase().split('to ')[1];
analyze(document.getElementById('i1'));
} else if (xx.toLowerCase().indexOf('three ') != -1) {
document.getElementById('i2').value=xx.toLowerCase().split('three ')[1];
analyze(document.getElementById('i2'));
} else if (xx.toLowerCase().indexOf('four ') != -1) {
document.getElementById('i3').value=xx.toLowerCase().split('four ')[1];
analyze(document.getElementById('i3'));
} else if (xx.toLowerCase().indexOf('five ') != -1) {
document.getElementById('i4').value=xx.toLowerCase().split('five ')[1];
analyze(document.getElementById('i4'));
} else if (xx.toLowerCase().indexOf('1 ') != -1) {
document.getElementById('i0').value=xx.toLowerCase().split('1 ')[1];
analyze(document.getElementById('i0'));
} else if (xx.toLowerCase().indexOf('2 ') != -1) {
document.getElementById('i1').value=xx.toLowerCase().split('2 ')[1];
analyze(document.getElementById('i1'));
} else if (xx.toLowerCase().indexOf('3 ') != -1) {
document.getElementById('i2').value=xx.toLowerCase().split('3 ')[1];
analyze(document.getElementById('i2'));
} else if (xx.toLowerCase().indexOf('4 ') != -1) {
document.getElementById('i3').value=xx.toLowerCase().split('4 ')[1];
analyze(document.getElementById('i3'));
} else if (xx.toLowerCase().indexOf('5 ') != -1) {
document.getElementById('i4').value=xx.toLowerCase().split('5 ')[1];
analyze(document.getElementById('i4'));
} else if (xx != '') {
another();
}
}
setTimeout(continuallylook, 500);
}
}
function onl() {
var i, j, k, crowh='<tr></tr>', crowd='<tr id=trd></tr>', vb='';
numplayers=location.search.split('numplayers=')[1] ? eval(location.search.split('numplayers=')[1].split('&')[0]) : numplayers;
document.getElementById('myselect').value='' + numplayers;
var cscores=location.search.split('scores=')[1] ? decodeURIComponent(location.search.split('scores=')[1].split('&')[0]) : '';
if (cscores != '') { scores=cscores.split(','); }
var cgoes=location.search.split('goes=')[1] ? decodeURIComponent(location.search.split('goes=')[1].split('&')[0]) : '';
if (cgoes != '') { goes=cgoes.split(','); }
var cplayers=location.search.split('players=')[1] ? decodeURIComponent(location.search.split('players=')[1].split('&')[0]) : '';
if (cplayers != '' && cplayers.length > 1) { players=cplayers.split(','); answers=cplayers.split(','); }
for (k=1; k<numplayers; k++) {
if (scores.length <= k) {
scores.push('0');
goes.push('0');
players.push('Player ' + eval(1 + k));
answers.push('');
}
}
precontinuallook();
for (i=0; i<numplayers; i++) {
if (numplayers == 2 && i == 0) {
vb=' and tab out';
vb=' ';
crowh=crowh.replace('</tr>', '<th id=th' + i + ' style="inline-block;width:' + eval(100 / numplayers) + '%;"><div id=c' + i + ' style=inline-block data-onblur=nanalyze(this); contenteditable=true>' + players[i] + '</div> ' + ddd + 'score <span id=sp' + i + '>' + scores[i] + '/' + goes[i] + '</span> ' + ddd + br + ' guess the one letter sector' + vb + ' <input onkeypress="vslast(event);" onkeydown="analnono=false;" data-onblur=setTimeout(izeroanalyze,1000); id=i' + i + ' type=text value=""></input></th></tr>');
vb=' via buttons below';
} else {
crowh=crowh.replace('</tr>', '<th id=th' + i + ' style="inline-block;width:' + eval(100 / numplayers) + '%;"><div id=c' + i + ' style=inline-block data-onblur=nanalyze(this); contenteditable=true>' + players[i] + '</div> ' + ddd + 'score <span id=sp' + i + '>' + scores[i] + '/' + goes[i] + '</span> ' + ddd + br + ' guess the one letter sector' + vb + ' <input onkeypress="vslast(event);" data-onblur=analyze(this); id=i' + i + ' type=text value=""></input></th></tr>');
vb='';
}
j=Math.floor(Math.random() * classes.length);
answers[i]=classes[j].replace(/_/g, ' ');
crowd=crowd.replace('</tr>', '<td style="vertical-align:top;border:1px solid red;" id=td' + i + '>' + twentyfive('<p id=d' + i + ' class=' + classes[j] + '></p>') + '</td></tr>');
}
document.getElementById('mytbody').innerHTML=crowh + crowd;
if (br == '<br>') {
document.getElementById('i0').style.width='60px';
document.getElementById('i1').style.width='60px';
document.getElementById('i2').style.width='60px';
document.getElementById('i3').style.width='60px';
document.getElementById('i4').style.width='60px';
}
if (numplayers == 2) {
setTimeout(andlat, 1000); //alert(1);
document.getElementById('i0').focus();
document.getElementById('th1').innerHTML+='<br>' + '<input class=kb type=button style=inline-block; onclick=append(this); value="a" id=ba1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="b" id=bb1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="c" id=bc1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="d" id=bd1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="e" id=be1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="f" id=bf1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="g" id=bg1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="h" id=bh1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="i" id=bi1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="j" id=bj1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="k" id=bk1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="l" id=bl1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="m" id=bm1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="n" id=bn1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="o" id=bo1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="p" id=bp1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="q" id=bq1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="r" id=br1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="s" id=bs1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="t" id=bt1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="u" id=bu1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="v" id=bv1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="w" id=bw1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="x" id=bx1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="y" id=by1></input> <input class=kb type=button style=inline-block; onclick=append(this); value="z" id=bz1></input> ';
} else {
setTimeout(andlat, 1000); //alert(1);
}
}
function andlat() {
if (document.getElementById('i' + eval(-1 + curkb))) {
document.getElementById('i' + eval(-1 + curkb)).focus();
}
}
function another() {
var i, j, xcrowd='';
for (i=0; i<numplayers; i++) {
j=Math.floor(Math.random() * classes.length);
answers[i]=classes[j].replace(/_/g, ' ');
xcrowd+='<td style=vertical-align:top; id=td' + i + '><p id=d' + i + ' class=' + classes[j] + '></p></td>';
document.getElementById('i' + i).value='';
}
document.getElementById('trd').innerHTML=xcrowd;
if (numplayers == 2) {
document.getElementById('i0').focus();
}
// if (br == '<br>') { top.document.getElementById('start_button').click(); }
}
function append(ibo) {
if (1 == 1) {
//curkb=2;
amiright(ibo.value.toUpperCase());
} else {
document.title+=' z';
analnono=true;
document.getElementById('i' + ibo.id.substring(2)).value+=ibo.id.substring(1,2);
if (document.getElementById('i' + ibo.id.substring(2)).value.toLowerCase().replace(/_/g,' ').replace('aubergine', 'eggplant').replace('grapes', 'grapX').replace('grape', 'grapes').replace('grapX', 'grapes').replace('cherry', 'cherries') == answers[1]) {
analnono=false;
analyze(document.getElementById('i' + ibo.id.substring(2)));
document.getElementById('i' + ibo.id.substring(2)).value='';
another();
} else if ((answers[1] + '~').indexOf(' ' + document.getElementById('i' + ibo.id.substring(2)).value.toLowerCase().replace(/_/g,' ') + '~') != -1) {
analnono=false;
analyze(document.getElementById('i' + ibo.id.substring(2)));
document.getElementById('i' + ibo.id.substring(2)).value='';
another();
}
all();
}
}
function all() {
document.getElementById('i0').focus();
}
function lhit(sv) {
var k;
var xscores='' + scores[0], xgoes='' + goes[0], xplayers='' + players[0];
numplayers=eval(sv);
for (k=1; k<numplayers; k++) {
if (scores.length <= k) {
scores.push('0');
goes.push('0');
players.push('Player ' + eval(1 + k));
answers.push('');
}
xscores+=',' + scores[k];
xgoes+=',' + goes[k];
xplayers+=',' + players[k];
}
if (1 == 2 && (navigator.userAgent.toLowerCase().indexOf('chrome') > -1 && eval('' + numplayers) > 2)) {
location.href='//www.rjmprogramming.com.au/PHP/speech_supervisor.php?mode=03';
} else {
location.href=document.URL.split('#')[0].split('?')[0] + '?scores=' + encodeURIComponent(xscores) + '&goes=' + encodeURIComponent(xgoes) + '&players=' + encodeURIComponent(xplayers) + '&numplayers=' + numplayers;
}
}
function twf() {
if (thetds.length == 0) {
myt=window.getComputedStyle(document.getElementById('mytable'));
//document.getElementById('myh3').innerHTML+=' left:' + myt.left + ' top:' + myt.top + ' width:' + myt.width + ' height:' + myt.height;
myz=window.getComputedStyle(document.getElementById('th0'));
//document.getElementById('myh3').innerHTML+=' left:' + myz.left + ' top:' + myz.top + ' width:' + myz.width + ' height:' + myz.height;
//alert(thetdids);
for (var ii=0; ii<thetdids.length; ii++) {
thetds.push(document.getElementById(thetdids[ii]));
thetdareas.push(document.getElementById(thetdids[ii]).getBoundingClientRect());
//document.getElementById('myh3').innerHTML+=' left:' + thetdareas[eval(-1 + thetdareas.length)].left + ' top:' + thetdareas[eval(-1 + thetdareas.length)].top + ' width:' + thetdareas[eval(-1 + thetdareas.length)].width + ' height:' + thetdareas[eval(-1 + thetdareas.length)].height;
}
var tdlot=document.getElementsByTagName('td');
for (var itd=0; itd<tdlot.length; itd++) {
if (tdlot[itd].innerHTML.length == 1) {
//alert(tdlot[itd].innerHTML + ': ' + tdlot[itd].getBoundingClientRect().top);
thegridtdihs.push(tdlot[itd].innerHTML);
thegridtdareas.push(tdlot[itd].getBoundingClientRect());
}
}
for (var jtd=0; jtd<numplayers; jtd++) {
document.getElementById('emj').innerHTML+='<div id=emj' + jtd + '></div>';
document.getElementById('emj' + jtd).innerHTML='<span id=s' + jtd + ' style="position:fixed;' + getmetop(jtd) + getmeleft(jtd) + 'opacity:1.0;z-index:90;" class=' + theclasses[jtd] + '></span>';
}
//alert(thetdareas);
//alert(thels);
//alert(thets);
obr=false;
setTimeout(poschange, 20);
}
}
function poschange() {
var wast=-1, wasl=-1, newt=-1, newl=-1;
//console.log('0');
for (var inn=0; inn<numplayers; inn++) {
//console.log('2');
if (eval('' + thetdareas.length) > eval('' + inn)) {
wast=thets[inn];
wasl=thels[inn];
//console.log('3');
newt=eval(('' + eval(wast - Math.floor(Math.random() * 30) + Math.floor(Math.random() * 30))).split('.')[0]);
newl=eval(('' + eval(wasl - Math.floor(Math.random() * 30) + Math.floor(Math.random() * 30))).split('.')[0]);
//alert('' + inn + ': ' + newt + ' ' + newl + ' ' + wast + ' ' + wasl + ' ... top=' + thetdareas[inn].top + ' ... bottom=' + thetdareas[inn].bottom + ' ... left=' + thetdareas[inn].left + ' ... right=' + thetdareas[inn].right);
//console.log(eval(Math.abs(eval(newt - wast)) + Math.abs(eval(newl - wasl))));
//setTimeout(poschange, 50);
//return '';
while (eval('' + newt) < eval(thetdareas[inn].top) || eval('' + newt) > eval(thetdareas[inn].bottom) || eval('' + newl) < eval(thetdareas[inn].left) || eval('' + newl) > eval(thetdareas[inn].right)) {
//if (eval('' + newt) < eval(thetdareas[inn].top)) alert('top');
//if (eval('' + newl) < eval(thetdareas[inn].left)) alert('' + inn + ' left:' + newl + ' vs ' + thetdareas[inn].left);
//if (eval('' + newt) > eval(thetdareas[inn].bottom)) alert('bottom');
//if (eval('' + newt) > eval(thetdareas[inn].right)) alert('right');
newt=eval(('' + eval(wast - Math.floor(Math.random() * 30) + Math.floor(Math.random() * 30))).split('.')[0]);
newl=eval(('' + eval(wasl - Math.floor(Math.random() * 30) + Math.floor(Math.random() * 30))).split('.')[0]);
//console.log(eval(Math.abs(eval(newt - wast)) + Math.abs(eval(newl - wasl))));
}
thets[inn]=newt; //eval(('' + eval(thetdareas[inn].top + Math.floor(Math.random() * thetdareas[inn].height))).split('.')[0]);
thels[inn]=newl; //eval(('' + eval(thetdareas[inn].left + Math.floor(Math.random() * thetdareas[inn].width))).split('.')[0]);
//document.title=' ' + '' + thels[inn] + 'px ' + '' + thets[inn] + 'px';
//document.getElementById('spn' + inn).style.left='' + thels[inn] + 'px';
//document.getElementById('spn' + inn).style.top='' + thets[inn] + 'px';
document.getElementById('emj' + inn).innerHTML='<span id=spn' + inn + ' style="position:fixed;left:' + thels[inn] + 'px;top:' + thets[inn] + 'px;' + 'opacity:1.0;z-index:90;" class=' + theclasses[inn] + '></span>';
}
}
if (!obr) { setTimeout(poschange, 20); } else { obr=false; }
}
function getmetop(inn) {
if (eval('' + thetdareas.length) > eval('' + inn)) {
thets.push(eval(('' + eval(thetdareas[inn].top + Math.floor(Math.random() * thetdareas[inn].height))).split('.')[0]));
return 'top:' + ('' + eval(thetdareas[inn].top + Math.floor(Math.random() * thetdareas[inn].height))).split('.')[0] + 'px;';
} else {
return '';
}
}
function getmeleft(inn) {
if (eval('' + thetdareas.length) > eval('' + inn)) {
thels.push(eval(('' + eval(thetdareas[inn].left + Math.floor(Math.random() * thetdareas[inn].width))).split('.')[0]));
return 'left:' + ('' + eval(thetdareas[inn].left + Math.floor(Math.random() * thetdareas[inn].width))).split('.')[0] + 'px;';
} else {
return '';
}
}
function twentyfive(pdhtml) {
var thei=pdhtml.split('=d')[1].split(' ')[0];
theclasses.push(pdhtml.split('class=')[1].split(' ')[0].split('>')[0]);
var arowis='<tr><td class=tds' + thei + ' style="border:1px solid red;width:20%;height:18%;">a</td><td class=tds' + thei + ' style="border:1px solid red;width:20%;height:18%;">b</td><td class=tds' + thei + ' style="border:1px solid red;width:20%;height:18%;">c</td><td class=tds' + thei + ' style="border:1px solid red;width:20%;height:18%;">d</td><td class=tds' + thei + ' style="border:1px solid red;width:20%;height:18%;">e</td><tr>';
if (thetdids.length == 0) {
for (var iop=0; iop<numplayers; iop++) {
thetdids.push('td' + iop);
}
} else if (1 == 2) {
thetdids.push('td' + thei);
}
setTimeout(twf, eval(1000 + eval(thei * 12000)));
//return '<table id=t' + thei + ' style=width:100%;height:60vh;>' + arowis + arowis.replace('>a<','>f<').replace('>b<','>g<').replace('>c<','>h<').replace('>d<','>i<').replace('>e<','>j<') + arowis.replace('>a<','>k<').replace('>b<','>l<').replace('>c<','>m<').replace('>d<','>n<').replace('>e<','>o<') + arowis.replace('>a<','>p<').replace('>b<','>q<').replace('>c<','>r<').replace('>d<','>s<').replace('>e<','>t<') + arowis.replace('>a<','>u<').replace('>b<','>v<').replace('>c<','>w<').replace('>d<','>x<').replace('>e<','>y<') + '</table>';
return '<table id=t' + thei + ' style=width:100%;height:calc(60vh - 0px);>' + arowis + arowis.replace('>a<','>f<').replace('>b<','>g<').replace('>c<','>h<').replace('>d<','>i<').replace('>e<','>j<') + arowis.replace('>a<','>k<').replace('>b<','>l<').replace('>c<','>m<').replace('>d<','>n<').replace('>e<','>o<') + arowis.replace('>a<','>p<').replace('>b<','>q<').replace('>c<','>r<').replace('>d<','>s<').replace('>e<','>t<') + arowis.replace('>a<','>u<').replace('>b<','>v<').replace('>c<','>w<').replace('>d<','>x<').replace('>e<','>y<') + '</table>';
}
function vslast(eiois) {
curkb=eval(1 + eval('' + eiois.target.id.replace('i','')));
if ((eiois.which || eiois.keyCode) == 8) {
eiois=eiois;
} else if ((eiois.which || eiois.keyCode) == 186 || (eiois.which || eiois.keyCode) == 900000016) {
eiois=eiois;
} else if ((eiois.which || eiois.keyCode) < 32) { // && (eiois.which || eiois.keyCode) != 32) { // || (eiois.which || eiois.keyCode) > 58) {
eiois=eiois;
} else if (eiois.keyCode >= 48 && eiois.keyCode <= 57) {
//alert(eiois.keyCode + ' ' + 'i' + eval(-1 + eval(('0123456789').charAt(eval(eiois.keyCode - 48)))));
if (document.getElementById('i' + eval(-1 + eval(('0123456789').charAt(eval(eiois.keyCode - 48)))))) {
eiois.target.value='';
curkb=eval('' + ('0123456789').charAt(eval(eiois.keyCode - 48)));
//alert(curkb);
document.getElementById('i' + eval(-1 + curkb)).value='';
setTimeout(akb, 200);
//document.getElementById('i' + eval(-1 + ('0123456789').charAt(eval(eiois.keyCode - 48)))).focus();
}
} else if (eiois.keyCode >= 65 && eiois.keyCode <= 90) {
//alert('guess is ' + curkb + ':' + ('abcdefghijklmnopqrstuvwxyz').charAt(eval(eiois.keyCode - 65)));
amiright(('abcdefghijklmnopqrstuvwxyz').charAt(eval(eiois.keyCode - 65)));
setTimeout(nakb, 200);
} else if (eiois.keyCode >= 97 && eiois.keyCode <= 122) {
//alert('guess is ' + curkb + ':' + ('abcdefghijklmnopqrstuvwxyz').charAt(eval(eiois.keyCode - 97)));
amiright(('abcdefghijklmnopqrstuvwxyz').charAt(eval(eiois.keyCode - 97)));
setTimeout(nakb, 200);
} else {
if (1 == 2) { alert(eiois.keyCode); }
}
//eiois.target.value='';
return true; //true;
}
function nakb() {
//alert('i' + eval(-1 + curkb));
document.getElementById('i' + eval(-1 + curkb)).value='';
}
function akb() {
//alert('i' + eval(-1 + curkb));
document.getElementById('i' + eval(-1 + curkb)).focus();
}
function amiright(thelet) {
var tofocus=null;
var win=false;
var acurkb=curkb;
if (thelet == thelet.toUpperCase()) { acurkb=2; thelet=thelet.toLowerCase(); tofocus=document.getElementById('i0'); }
var inn=eval(-1 + acurkb);
var wass='' + scores[inn] + '/' + goes[inn];
//alert(wass);
var ioffset=eval(eval(-1 + acurkb) * 25 + eval('' + ('abcdefghijklmnopqrstuvwxyz').indexOf(thelet.toLowerCase())));
if (document.getElementById('spn' + inn) && (thelet.toLowerCase() == 'z' || lastxx != ('' + acurkb + thelet.toLowerCase()))) {
if (thelet.toLowerCase() != 'z' || 1 == 1) { lastxx=('' + acurkb + thelet.toLowerCase()); }
goes[inn]='' + eval(1 + eval('' + goes[inn]));
//alert('guess is ' + curkb + ':' + thelet + ' ... ' + ioffset + ' inn=' + inn + ' goes[inn]=' + goes[inn]);
var thist=eval(('' + document.getElementById('spn' + inn).style.top).replace('px',''));
var thisl=eval(('' + document.getElementById('spn' + inn).style.left).replace('px',''));
if (thelet.toLowerCase() == 'z') {
ioffset--;
while (ioffset >= 0) {
if (thist >= eval('' + thegridtdareas[ioffset].top) && thist <= eval('' + thegridtdareas[ioffset].bottom)) {
//document.getElementById('myh3').innerHTML+=' ' + ('' + curkb + thelet) + ' Vs ' + thegridtdihs[ioffset] + ' ... ';
if (thisl >= eval('' + thegridtdareas[ioffset].left) && thisl <= eval('' + thegridtdareas[ioffset].right)) {
//document.getElementById('myh3').innerHTML+=' ' + ('' + curkb + thelet) + ' VS ' + thegridtdihs[ioffset] + ' ... ';
win=true;
}
}
if (thegridtdihs[ioffset] == 'a' || win) { ioffset=-1; } else { ioffset--; }
}
if (!win) {
scores[inn]='' + eval(1 + eval('' + scores[inn]));
}
} else {
//document.getElementById('myh3').innerHTML+=' ' + ('' + curkb + thelet) + ' vs ' + thegridtdihs[ioffset] + ' ... ';
if (thist >= eval('' + thegridtdareas[ioffset].top) && thist <= eval('' + thegridtdareas[ioffset].bottom)) {
//document.getElementById('myh3').innerHTML+=' ' + ('' + curkb + thelet) + ' Vs ' + thegridtdihs[ioffset] + ' ... ';
if (thisl >= eval('' + thegridtdareas[ioffset].left) && thisl <= eval('' + thegridtdareas[ioffset].right)) {
//document.getElementById('myh3').innerHTML+=' ' + ('' + curkb + thelet) + ' VS ' + thegridtdihs[ioffset] + ' ... ';
scores[inn]='' + eval(1 + eval('' + scores[inn]));
}
}
//alert(wass + ' vs ' + '' + scores[inn] + '/' + goes[inn]);
}
document.getElementById('sp' + inn).innerHTML=document.getElementById('sp' + inn).innerHTML.replace(wass, '' + scores[inn] + '/' + goes[inn]);
if (tofocus) { tofocus.focus(); }
}
}
function pretwf() {
myt=null;
myz=null;
thetds=[];
thetdareas=[];
//thetdids=[];
//theclasses=[];
thels=[];
thets=[];
thegridtdareas=[];
thegridtdihs=[];
obr=true;
document.getElementById('emj').innerHTML='';
for (var iij=0; iij<numplayers; iij++) {
document.getElementById('t' + iij).style.height='calc(60vh ' + ('- ' + eval(wwt - window.innerHeight)).replace('- -','+ ') + 'px)';
}
setTimeout(twf, 700);
}
</script>
</head>
<body onload='wwt=window.innerHeight; onl();' onkeypress="vslast(event);" onresize="pretwf();">
<h1>Emoji in Sector Game for <select id=myselect onchange='lhit(this.value);'><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option><option value='5'>5</option></select></h1>
<h3 id=myh3>RJM Programming</h3>
<h3>August, 2021 ... Thanks to <a target=_blank title='Iemoji' href='https://www.iemoji.com'>Iemoji</a></h3>
<table id=mytable style='width:100%;text-align:center;position:absolute;top:175px;left:0px;' border=10>
<tbody id=mytbody>
</tbody>
</table>
<div id=econtent></div>
<input type=text style='position:absolute;top:-200px;left:-200px;' value=''></input>
<div id=emj></div><div id=estyle></div>
</body>
</html>