<!doctype html>
<html>
<head>
<link href='//www.rjmprogramming.com.au/PHP/emboss_h1.css' rel='stylesheet' type='text/css'>
<title>Bulls and Cows Game for Two - One on Mouse and One at Keyboard - RJM Programming - December, 2022</title>
<style>
input[type=password] { font-size: 24px; }
@media only screen and (min-device-width: 320px) and (max-device-width: 765px) and (orientation: portrait) {
.tablek { text-align: right; }
.tablem { text-align: left; }
#pwd1 { width:50%; text-align:right; }
#pwd2 { width:50%; text-align:left; }
input[type=password] { font-size: 24px; }
}
@media only screen and (min-device-width: 320px) and (max-device-width: 765px) and (orientation: landscape) {
.tablek { text-align: right; }
.tablem { text-align: left; }
#pwd1 { width:50%; text-align:right; }
#pwd2 { width:50%; text-align:left; }
input[type=password] { font-size: 24px; }
}
.glow {
-webkit-animation: glow 1s linear infinite alternate;
-moz-animation: glow 1s linear infinite alternate;
animation: glow 1s linear infinite alternate;
}
/* Thanks to https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_glowing_text */
@keyframes glow {
from {
box-shadow: 0 0 3px #fff, 0 0 5px #fff, 0 0 37px #e60073, 0 0 9px #e60073, 0 0 11px #e60073, 0 0 13px #e60073, 0 0 15px #e60073;
}
to {
box-shadow: 0 0 24px #fff, 0 0 6px #ff4da6, 0 0 8px #ff4da6, 0 0 10px #ff4da6, 0 0 12px #ff4da6, 0 0 14px #ff4da6, 0 0 16px #ff4da6;
}
}
td { text-align: center; }
table { border: 5px teal solid; }
#letter1 { visibility: hidden; }
h1.aa:after {
content: 'a';
}
h1.ab:after {
content: 'b';
}
h1.ac:after {
content: 'c';
}
h1.ad:after {
content: 'd';
}
h1.ae:after {
content: 'e';
}
h1.af:after {
content: 'f';
}
h1.ag:after {
content: 'g';
}
h1.ah:after {
content: 'h';
}
h1.ai:after {
content: 'i';
}
h1.aj:after {
content: 'j';
}
h1.ak:after {
content: 'k';
}
h1.al:after {
content: 'l';
}
h1.am:after {
content: 'm';
}
h1.an:after {
content: 'n';
}
h1.ao:after {
content: 'o';
}
h1.ap:after {
content: 'p';
}
h1.aq:after {
content: 'q';
}
h1.ar:after {
content: 'r';
}
h1.as:after {
content: 's';
}
h1.at:after {
content: 't';
}
h1.au:after {
content: 'u';
}
h1.av:after {
content: 'v';
}
h1.aw:after {
content: 'w';
}
h1.ax:after {
content: 'x';
}
h1.ay:after {
content: 'y';
}
h1.az:after {
content: 'z';
}
span.aa:after {
content: 'a';
}
span.ab:after {
content: 'b';
}
span.ac:after {
content: 'c';
}
span.ad:after {
content: 'd';
}
span.ae:after {
content: 'e';
}
span.af:after {
content: 'f';
}
span.ag:after {
content: 'g';
}
span.ah:after {
content: 'h';
}
span.ai:after {
content: 'i';
}
span.aj:after {
content: 'j';
}
span.ak:after {
content: 'k';
}
span.al:after {
content: 'l';
}
span.am:after {
content: 'm';
}
span.an:after {
content: 'n';
}
span.ao:after {
content: 'o';
}
span.ap:after {
content: 'p';
}
span.aq:after {
content: 'q';
}
span.ar:after {
content: 'r';
}
span.as:after {
content: 's';
}
span.at:after {
content: 't';
}
span.au:after {
content: 'u';
}
span.av:after {
content: 'v';
}
span.aw:after {
content: 'w';
}
span.ax:after {
content: 'x';
}
span.ay:after {
content: 'y';
}
span.az:after {
content: 'z';
}
.cell {
background-color: lightgreen;
display: inline;
}
</style>
<script src="http://api.jquery.com/jquery-wp-content/themes/jquery/js/modernizr.custom.2.6.2.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write(unescape('%3Cscript src="//api.jquery.com/jquery-wp-content/themes/jquery/js/jquery-1.9.1.min.js"%3E%3C/script%3E'))</script>
<script src="//api.jquery.com/jquery-wp-content/themes/jquery/js/plugins.js"></script>
<script src="//api.jquery.com/jquery-wp-content/themes/jquery/js/main.js"></script>
<script src="//use.typekit.net/wde1aof.js"></script>
<script>try{Typekit.load();}catch(e){}</script><script type='text/javascript' src='//api.jquery.com/wp-includes/js/comment-reply.min.js?ver=3.8'></script>
<script type='text/javascript'>
var synonym_mode=false, wrcont='', httpbit=document.URL.split(':')[0];
var ourpgoes=1;
var goes=0;
var cscore="-1,0,0";
var score=[-1,0,0];
var cname=",Player 1,Player 2";
var name=cname.split(',');
var cstatus=", ... on mouse ... , ... at keyboard ... ";
var status=cstatus.split(',');
var aconto=null;
var htmls=['','',''];
var wos=[null,null,null];
var bconto=null;
var letterlist="";
var pleasewait=false;
var versus="";
var player1='Player 1', player2='Player 2';
var activeplayer=-1;
var thewordtoguess="";
var startwith=3;
var totallength=0;
var donelist=";";
var startofgame=true;
var inalready=false;
var lwg="";
var vstwo='';
var firstgo=true, fgo=true;
var ourname=['','Player 1','Player 2'];
var ourstatus=['','',''];
var one='', two='';
var esblurb='. Involve an uppercase email address for running commentary that might replace you taking hand written notes. Involve [NEW WINDOW] for continuous running commentary in a popup window or a lowercase version for commentary after a click. Involve [mobile number] for running commentary via SMS. Involve non-uppercase email address for running commentary via a mailto email.';
var zform=null, zhr=null;
function spanize(inst) {
var jnst=inst.replace(/\,/g, '</span>');
while (jnst.indexOf(String.fromCharCode(13)) != -1) {
jnst=jnst.replace(String.fromCharCode(13), '</span>');
}
while (jnst.indexOf(String.fromCharCode(10)) != -1) {
jnst=jnst.replace(String.fromCharCode(10), '<span>');
}
while (jnst.indexOf(' ') != -1) {
jnst=jnst.replace(' ', '<span>');
}
return jnst;
}
function continueon() {
if (!synonym_mode) {
if (pleasewait) {
setTimeout(continueon, 4000);
} else if (eval(startwith) < eval(totallength)) {
var ij, jk, guess;
startwith++;
for (jk=startwith; jk<=startwith; jk++) {
for (ij=jk; ij<=jk; ij++) {
guess=Math.floor(Math.random() * eval(0 + thewordtoguess.length)) + 0;
while (donelist.indexOf(";" + guess + ";") != -1) {
guess=Math.floor(Math.random() * eval(0 + thewordtoguess.length)) + 0;
}
// donelist += guess + ";";
// letters+=thewordtoguess.substring(guess, eval(1 + guess));
// document.getElementById('letter' + map(startwith)).innerHTML+='<h1 class="a' + thewordtoguess.substring(guess, eval(1 + guess)) + ' cell"></h1>';
// document.getElementById('letter' + map(startwith)).style.display='BLOCK';
}
}
if (eval(startwith) < eval(totallength)) {
setTimeout(continueon, 4000);
} else {
document.getElementById('letter' + map(startwith)).innerHTML+='<font color=red>.</font>';
setTimeout(istimeout, 7000);
}
}
} else if (wrcont == '') {
$.ajax({ url: httpbit + "://www.wordreference.com/synonyms/" + encodeURIComponent(thewordtoguess),
type: 'get',
success: function(oput) {
var output=JSON.stringify(oput);
wrcont='';
if (output.indexOf('No thesaurus entry found for ') != -1) {
document.getElementById('myiframe').src=document.getElementById('myiframe').src.replace('youllneverfindthis=', 'youllneverfindthis=x');
} else {
document.getElementById('letter1').innerHTML=thewordtoguess;
wrcont=spanize(output);
//alert(output);
}
}
});
}
}
function istimeout() {
if (1 == 5 && document.getElementById('letter' + map(startwith)).innerHTML.indexOf(".") != -1 && document.getElementById('whatyouhavesofar').innerHTML == "") {
document.getElementById('myh3').innerHTML+=' ... word was <font color=red><a target=_blank onclick="nothing();" ontouchstart="nothing();" onkeyup="nothing();" title="Look up word in dictionary" href="http://www.thefreedictionary.com/' + thewordtoguess + '">' + thewordtoguess + '</a></font> ... onto the next ... ';
setTimeout(another, 5000);
}
}
function iframecheck(iois) {
if (iois != null) {
aconto = (iois.contentWindow || iois.contentDocument);
if (aconto != null) {
if (aconto.document) { aconto = aconto.document; }
if (aconto.body != null) {
thewordtoguess=aconto.body.innerHTML.toLowerCase();
if (synonym_mode) {
$.ajax({ url: httpbit + "://www.wordreference.com/synonyms/" + encodeURIComponent(thewordtoguess),
type: 'get',
success: function(oput) {
var output=JSON.stringify(oput);
wrcont='';
if (output.indexOf('No thesaurus entry found for ') != -1) {
document.getElementById('myiframe').src=document.getElementById('myiframe').src.replace('youllneverfindthis=', 'youllneverfindthis=x');
} else {
document.getElementById('letter1').innerHTML=thewordtoguess;
wrcont=spanize(output);
//alert(output);
}
}
});
} else {
if (thewordtoguess != "") {
document.getElementById('myh3').innerHTML='RJM Programming - December, 2022';
document.getElementById('whatyouhavesofar').innerHTML='';
totallength=thewordtoguess.length;
startwith=3;
letters="";
donelist=";";
//alert(thewordtoguess);
var ij, jk, guess;
for (jk=1; jk<=startwith; jk++) {
for (ij=jk; ij<=jk; ij++) {
guess=Math.floor(Math.random() * eval(0 + thewordtoguess.length)) + 0;
while (donelist.indexOf(";" + guess + ";") != -1) {
guess=Math.floor(Math.random() * eval(0 + thewordtoguess.length)) + 0;
}
donelist += guess + ";";
letters+=thewordtoguess.substring(guess, eval(1 + guess));
//alert(thewordtoguess + " ... " + guess);
document.getElementById('letter' + map(jk)).innerHTML+='<h1 class="a' + thewordtoguess.substring(guess, eval(1 + guess)) + ' cell"></h1>';
//alert(thewordtoguess + " +++ " + guess);
document.getElementById('letter' + map(jk)).style.display='BLOCK';
//alert(thewordtoguess + " --- " + guess);
}
}
setTimeout(continueon, 4000);
}
}
}
}
}
}
function map(ind) {
return 1;
}
function postsiv() {
document.getElementById('tcell').scrollIntoView();
}
function siv() {
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPJUNKad|iPod|Opera Mini|IEMobile/i)) {
setTimeout(postsiv, 2000); //document.getElementById('tcell').scrollIntoView(); //versus=versus;
}
}
function pfocus() {
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPJUNKad|iPod|Opera Mini|IEMobile/i)) {
document.getElementById('tablel').style.align='right'; //versus=versus;
} else {
document.getElementById('pwd2').focus();
}
}
function neww() {
document.getElementById('pwd1').value='';
document.getElementById('pwd1').title='';
document.getElementById('pwd1').placeholder='';
document.getElementById('pwd2').value='';
document.getElementById('pwd2').title='';
document.getElementById('pwd2').placeholder='';
document.getElementById('player1').placeholder=document.getElementById('splayer1').innerHTML;
document.getElementById('player2').placeholder=document.getElementById('splayer2').innerHTML;
versus="";
document.getElementById('myiframehastobe').src='/PHP/surprise.php?min=4&max=8&youllneverfindthis=y'; // + '&hastobe=' + wordguess.toLowerCase();
pfocus(); // document.getElementById('pwd2').focus();
}
function onetwo() {
document.getElementById('pwd1').placeholder=one;
document.getElementById('pwd2').placeholder=two;
}
function fgf() {
firstgo=false;
}
function fg(isf) {
if (!isf) { setTimeout(fgf, 2000); return firstgo; }
return isf;
}
function iframeverify(iois) {
var qqs='???????????????????????????????????????????????';
if (iois != null) {
bconto = (iois.contentWindow || iois.contentDocument);
if (bconto != null) {
if (bconto.document) { bconto = bconto.document; }
if (bconto.body != null) {
ourname=cname.split(",");
ourscore=cscore.split(",");
ourstatus=cstatus.split(",");
if (!firstgo) {
one=document.getElementById('pwd1').placeholder;
two=document.getElementById('pwd2').placeholder;
setTimeout(onetwo, 300);
// document.getElementById('player1').placeholder=document.getElementById('pwd1').placeholder; //document.getElementById('splayer1').innerHTML;
// document.getElementById('player2').placeholder='3' + document.getElementById('pwd2').placeholder; //document.getElementById('splayer2').innerHTML;
}
versus=(bconto.body.innerHTML);
document.getElementById('nw').className='glow';
document.getElementById('nw').innerHTML=' ' + versus.length + ' letter ';
document.getElementById('pwd1').placeholder='' + versus.length + ' letter word';
document.getElementById('pwd2').placeholder='' + versus.length + ' letter word';
htmls[1]='<html><head><scr' + 'ipt type=text/javascript> function reveal() { var dets=document.getElementsByTagName("details"); for (var i=0; i<dets.length; i++) { dets[i].open=true; } } </scr' + 'ipt></head><body><table cellpadding=8 cellspacing=8 border=5><thead><tr><th colspan=3>Bulls and Cows English ' + versus.length + ' letter Word Game</th></tr><tr><th>Your Guess <button onclick=reveal();>Reveal</button></th><th colspan=2>Result</th></tr></thead><tbody></tbody></table></body></html>';
htmls[2]=htmls[1].replace('Your Guess',player2 + ' Guess');
htmls[1]=htmls[1].replace('Your Guess',player1 + ' Guess');
if (fgo && versus == "") {
if (document.getElementById('player1').placeholder != '' && document.getElementById('splayer1').innerHTML == 'Player 1 Name') { document.getElementById('splayer1').innerHTML=document.getElementById('player1').placeholder; }
if (document.getElementById('player2').placeholder != '' && document.getElementById('splayer2').innerHTML == 'Player 2 Name') { document.getElementById('splayer2').innerHTML=document.getElementById('player2').placeholder; }
if (document.getElementById('player1').placeholder == '') { document.getElementById('player1').placeholder=document.getElementById('player1').value; document.getElementById('splayer1').innerHTML=document.getElementById('player1').value; document.getElementById('player1').value=''; }
if (document.getElementById('player2').placeholder == '') { document.getElementById('player2').placeholder=document.getElementById('player2').value; document.getElementById('splayer2').innerHTML=document.getElementById('player2').value; document.getElementById('player2').value=''; }
} //else {
//document.getElementById('player1').placeholder=document.getElementById('pwd1').placeholder; //document.getElementById('splayer1').innerHTML;
//document.getElementById('player2').placeholder='3' + document.getElementById('pwd2').placeholder; //document.getElementById('splayer2').innerHTML;
//}
//alert(document.getElementById('player1').placeholder);
//alert(document.getElementById('splayer1').innerHTML);
//alert(document.getElementById('player1').value);
//if (document.URL.indexOf('secret') != -1) {
//document.getElementById('numletters').innerHTML=versus + ' ' + versus.length + ' letter word';
//} else {
document.getElementById('numletters').innerHTML='English ' + versus.length + ' letter word';
//}
//alert(qqs.substring(0,versus.length) + ' (' + versus.length + ' letters)');
fgo=true;
if (window.self !== window.top) { if (firstgo) { firstgo=fg(false); } else { pfocus(); } } else { firstgo=fg(false); pfocus(); }
return '';
if (bconto.body.innerHTML.toLowerCase() == versus.toLowerCase() || (versus != "" && versus.trim() == "")) {
pleasewait=true;
var blb="Hard luck, " + ourname[activeplayer] + ", but the word was " + bconto.body.innerHTML;
if (bconto.body.innerHTML.toLowerCase() == versus.toLowerCase()) {
blb="Congratulations, " + ourname[activeplayer] + ", you score " + bconto.body.innerHTML.toLowerCase().length + " points for the word " + versus.toLowerCase();
score[activeplayer]+=eval(bconto.body.innerHTML.toLowerCase().length);
ourscore[activeplayer]=score[activeplayer];
}
versus="";
document.getElementById('summary' + activeplayer).innerHTML = ourname[activeplayer] + ourstatus[activeplayer] + "Score: " + score[activeplayer];
//alert(blb);
lwg="";
pleasewait=false;
if (eval(startwith) >= eval(totallength)) {
document.getElementById('thewordtoguess').innerHTML="<table><tr><td id='letter1' style='display:none;'></td><td id='letter2' style='display:none;'></td><td id='letter3' style='display:none;'></td><td id='letter4' style='display:none;'></td><td id='letter5' style='display:none;'></td><td id='letter6' style='display:none;'></td><td id='letter7' style='display:none;'></td><td id='letter8' style='display:none;'></td></tr></table>";
document.getElementById('myiframe').src+='1';
}
} else if (startofgame) {
startofgame=false;
} else {
pleasewait=true;
var blurb="Your word is not a known word ... sorry ... word we wanted was " + thewordtoguess;
versus="";
if (eval(startwith) >= eval(totallength)) {
var afters=prompt(blurb + ". If you leave " + thewordtoguess + " as your answer we will take you to a dictionary lookup of that word.", thewordtoguess);
if (afters != null) {
if (afters == thewordtoguess) {
window.open("http://www.thefreedictionary.com/" + thewordtoguess, "_blank", "left=50,top=50,width=400,height=400");
}
}
} else {
alert("Your word is not a known word ... sorry.");
}
lwg="";
pleasewait=false;
if (eval(startwith) >= eval(totallength)) {
document.getElementById('thewordtoguess').innerHTML="<table><tr><td id='letter1' style='display:none;'></td><td id='letter2' style='display:none;'></td><td id='letter3' style='display:none;'></td><td id='letter4' style='display:none;'></td><td id='letter5' style='display:none;'></td><td id='letter6' style='display:none;'></td><td id='letter7' style='display:none;'></td><td id='letter8' style='display:none;'></td></tr></table>";
document.getElementById('myiframe').src+='1';
}
}
}
}
}
pleasewait=false;
}
function verify() {
if (pleasewait) setTimeout(verify, 500);
}
function thegames1() {
if (document.getElementById('whatyouhavesofar').innerHTML == '') {
thegames(1);
}
}
function thegames2() {
thegames(2);
}
function thegames(whobuzzedin) {
//if (!inalready) {
//inalready=true;
return '';
var blb="";
ourname=cname.split(",");
ourstatus=cstatus.split(",");
ourscore=cscore.split(",");
var delim="", bigletters="", okay=false, letterscopy=letters.toLowerCase();
document.getElementById('thewordtoguess').innerHTML=document.getElementById('thewordtoguess').innerHTML.replace(".","");
activeplayer=eval(whobuzzedin);
pleasewait=true;
for (var i=0; i<letters.length; i++) {
bigletters+=delim + letters.toLowerCase().substring(i, eval(1 + i));
delim = ",";
}
return '';
var wordguess=document.getElementById('pwd' + eval(1 + activeplayer)).value; //lwg;
if (wordguess.length == versus.length && eval('' + wordguess.length) > 0) {
alert(ourname[activeplayer] + ' guesses ' + wordguess);
} else {
alert(ourname[activeplayer] + ' guesses ' + wordguess + ' versus ' + versus);
return '';
}
if (wordguess.trim() == "") {
if (synonym_mode) {
wordguess=prompt("Okay, " + ourname[activeplayer] + " what is your synonym for " + document.getElementById('letter1').innerHTML + "?", lwg);
if (wordguess == null) { wordguess=" "; }
if (wordguess.trim() == "" && wordguess != "") {
blb="Hard luck, " + ourname[activeplayer];
versus="";
score[activeplayer]+=0; //eval(bconto.body.innerHTML.toLowerCase().length);
ourscore[activeplayer]=score[activeplayer];
document.getElementById('summary' + activeplayer).innerHTML = ourname[activeplayer] + ourstatus[activeplayer] + "Score: " + score[activeplayer];
alert(blb);
pleasewait=false;
//document.getElementById('thewordtoguess').innerHTML="<table><tr><td id='letter1' style='display:none;'></td><td id='letter2' style='display:none;'></td><td id='letter3' style='display:none;'></td><td id='letter4' style='display:none;'></td><td id='letter5' style='display:none;'></td><td id='letter6' style='display:none;'></td><td id='letter7' style='display:none;'></td><td id='letter8' style='display:none;'></td></tr></table>";
document.getElementById('letter1').innerHTML='';
wrcont='';
document.getElementById('myiframe').src+='1';
} else if (wrcont.indexOf("<span>" + wordguess + "</span>") != -1) {
return '';
blb="Congratulations, " + ourname[activeplayer] + ", you score " + wordguess.length + " points for the correct synonym " + wordguess;
versus="";
score[activeplayer]+=eval(wordguess.length);
ourscore[activeplayer]=score[activeplayer];
document.getElementById('summary' + activeplayer).innerHTML = ourname[activeplayer] + ourstatus[activeplayer] + "Score: " + score[activeplayer];
//alert(blb);
pleasewait=false;
//document.getElementById('thewordtoguess').innerHTML="<table><tr><td id='letter1' style='display:none;'></td><td id='letter2' style='display:none;'></td><td id='letter3' style='display:none;'></td><td id='letter4' style='display:none;'></td><td id='letter5' style='display:none;'></td><td id='letter6' style='display:none;'></td><td id='letter7' style='display:none;'></td><td id='letter8' style='display:none;'></td></tr></table>";
document.getElementById('letter1').innerHTML='';
wrcont='';
document.getElementById('myiframe').src+='1';
} else {
return '';
blb="Hard luck, " + ourname[activeplayer];
versus="";
score[activeplayer]+=0; //eval(bconto.body.innerHTML.toLowerCase().length);
ourscore[activeplayer]=score[activeplayer];
document.getElementById('summary' + activeplayer).innerHTML = ourname[activeplayer] + ourstatus[activeplayer] + "Score: " + score[activeplayer];
alert(blb);
pleasewait=false;
//document.getElementById('thewordtoguess').innerHTML="<table><tr><td id='letter1' style='display:none;'></td><td id='letter2' style='display:none;'></td><td id='letter3' style='display:none;'></td><td id='letter4' style='display:none;'></td><td id='letter5' style='display:none;'></td><td id='letter6' style='display:none;'></td><td id='letter7' style='display:none;'></td><td id='letter8' style='display:none;'></td></tr></table>";
document.getElementById('letter1').innerHTML='';
wrcont='';
document.getElementById('myiframe').src+='1';
}
wordguess=null;
} else {
wordguess=prompt("Okay " + ourname[eval(whobuzzedin)] + " you have the letters " + bigletters + " ... what is your word?", lwg);
}
}
if (wordguess != null) {
wordguess=wordguess.replace(".","");
lwg=wordguess;
if (wordguess.trim() == "" && wordguess != "") {
blb="Hard luck, " + ourname[activeplayer] + ", but the word " + thewordtoguess + " is what we were looking for.";
versus="";
score[activeplayer]+=0; //eval(bconto.body.innerHTML.toLowerCase().length);
ourscore[activeplayer]=score[activeplayer];
document.getElementById('summary' + activeplayer).innerHTML = ourname[activeplayer] + ourstatus[activeplayer] + "Score: " + score[activeplayer];
alert(blb);
pleasewait=false;
document.getElementById('thewordtoguess').innerHTML="<table><tr><td id='letter1' style='display:none;'></td><td id='letter2' style='display:none;'></td><td id='letter3' style='display:none;'></td><td id='letter4' style='display:none;'></td><td id='letter5' style='display:none;'></td><td id='letter6' style='display:none;'></td><td id='letter7' style='display:none;'></td><td id='letter8' style='display:none;'></td></tr></table>";
document.getElementById('myiframe').src+='1';
} else if (wordguess.length == letters.length) {
for (var j=0; j<wordguess.length; j++) {
letterscopy=letterscopy.replace(wordguess.toLowerCase().substring(j, eval(j + 1)), "");
}
if (letterscopy == "") {
versus=wordguess.toLowerCase();
if (wordguess.toLowerCase() == thewordtoguess) {
blb="Congratulations, " + ourname[activeplayer] + ", you score " + bconto.body.innerHTML.toLowerCase().length + " points for the word " + versus.toLowerCase();
versus="";
score[activeplayer]+=eval(bconto.body.innerHTML.toLowerCase().length);
ourscore[activeplayer]=score[activeplayer];
document.getElementById('summary' + activeplayer).innerHTML = ourname[activeplayer] + ourstatus[activeplayer] + "Score: " + score[activeplayer];
//alert(blb);
pleasewait=false;
document.getElementById('thewordtoguess').innerHTML="<table><tr><td id='letter1' style='display:none;'></td><td id='letter2' style='display:none;'></td><td id='letter3' style='display:none;'></td><td id='letter4' style='display:none;'></td><td id='letter5' style='display:none;'></td><td id='letter6' style='display:none;'></td><td id='letter7' style='display:none;'></td><td id='letter8' style='display:none;'></td></tr></table>";
document.getElementById('myiframe').src+='1';
} else {
pleasewait=true;
setTimeout(verify, 500);
//alert('/PHP/surprise.php?min=4&max=8&youllneverfindthis=y' + '&hastobe=' + wordguess.toLowerCase());
document.getElementById('myh3').innerHTML+=' ... please wait while we look up <font color=red><a target=_blank onclick="nothing();" ontouchstart="nothing();" onkeyup="nothing();" title="Look up word in dictionary" href="http://www.thefreedictionary.com/' + wordguess.toLowerCase() + '">' + wordguess.toLowerCase() + '</a></font> ... ';
document.getElementById('myiframehastobe').src='/PHP/surprise.php?min=4&max=8&youllneverfindthis=y'; // + '&hastobe=' + wordguess.toLowerCase();
if (window.self !== window.top) { lwg=lwg; } else { pfocus(); } // document.getElementById('pwd2').focus(); }
lwg="";
}
} else {
alert("Your word has the wrong letters ... sorry.");
lwg="";
if (eval(startwith) >= eval(totallength)) {
pleasewait=false;
document.getElementById('thewordtoguess').innerHTML="<table><tr><td id='letter1' style='display:none;'></td><td id='letter2' style='display:none;'></td><td id='letter3' style='display:none;'></td><td id='letter4' style='display:none;'></td><td id='letter5' style='display:none;'></td><td id='letter6' style='display:none;'></td><td id='letter7' style='display:none;'></td><td id='letter8' style='display:none;'></td></tr></table>";
document.getElementById('myiframe').src+='1';
}
}
} else {
alert("Your word is not the correct length ... sorry.");
lwg="";
if (eval(startwith) >= eval(totallength)) {
pleasewait=false;
document.getElementById('thewordtoguess').innerHTML="<table><tr><td id='letter1' style='display:none;'></td><td id='letter2' style='display:none;'></td><td id='letter3' style='display:none;'></td><td id='letter4' style='display:none;'></td><td id='letter5' style='display:none;'></td><td id='letter6' style='display:none;'></td><td id='letter7' style='display:none;'></td><td id='letter8' style='display:none;'></td></tr></table>";
document.getElementById('myiframe').src+='1';
}
}
} else if (!synonym_mode) {
alert("Keep trying.");
lwg="";
if (eval(startwith) >= eval(totallength)) {
pleasewait=false;
document.getElementById('thewordtoguess').innerHTML="<table><tr><td id='letter1' style='display:none;'></td><td id='letter2' style='display:none;'></td><td id='letter3' style='display:none;'></td><td id='letter4' style='display:none;'></td><td id='letter5' style='display:none;'></td><td id='letter6' style='display:none;'></td><td id='letter7' style='display:none;'></td><td id='letter8' style='display:none;'></td></tr></table>";
document.getElementById('myiframe').src+='1';
}
}
inalready=false;
window.scrollTo(0,0);
//} else {
//inalready=false;
//}
}
function another() {
return '';
document.getElementById('thewordtoguess').innerHTML="<table><tr><td id='letter1' style='display:none;'></td><td id='letter2' style='display:none;'></td><td id='letter3' style='display:none;'></td><td id='letter4' style='display:none;'></td><td id='letter5' style='display:none;'></td><td id='letter6' style='display:none;'></td><td id='letter7' style='display:none;'></td><td id='letter8' style='display:none;'></td></tr></table>";
document.getElementById('myiframe').src+='1';
}
function pwdonkd(event) {
if (eval('' + event.keyCode) >= 65 && eval('' + event.keyCode) <= 90) {
vstwo+=String.fromCharCode(eval('' + event.keyCode));
activeplayer=2;
setTimeout(assesstwo,500);
}
//event.stopPropagation();
}
function assesstwo() {
var bks=' ';
var bef='', aft='';
var bullcount=0;
var cowcount=0;
var vversus=versus;
//document.getElementById('pwd2').value+=inletter;
var aguess=vstwo;
if (vstwo.length == versus.length && eval('' + vstwo.length) > 0) {
document.getElementById('pwd2').placeholder='';
for (var ii=0; ii<versus.length; ii++) {
if (versus.substring(ii).substring(0,1).toLowerCase() == vstwo.substring(ii).substring(0,1).toLowerCase()) {
bullcount++;
document.getElementById('pwd2').placeholder=String.fromCodePoint(128002) + document.getElementById('pwd2').placeholder; //'🐂 ';
//document.getElementById('player2').placeholder+=String.fromCodePoint(128002); //'🐂 ';
} else if (vversus.toLowerCase().indexOf(vstwo.substring(ii).substring(0,1).toLowerCase()) != -1) {
bef='';
aft='';
if (vversus.toLowerCase().indexOf(vstwo.substring(ii).substring(0,1).toLowerCase()) >= 0) {
bef=vversus.substring(0,vversus.toLowerCase().indexOf(vstwo.substring(ii).substring(0,1).toLowerCase()));
}
if (eval(1 + vversus.toLowerCase().indexOf(vstwo.substring(ii).substring(0,1).toLowerCase())) < eval('' + versus.length)) {
aft=vversus.substring(eval(1 + vversus.toLowerCase().indexOf(vstwo.substring(ii).substring(0,1).toLowerCase())));
}
//alert(document.getElementById('pwd2').value + ' ... ' + document.getElementById('pwd2').value.substring(ii).substring(0,1).toLowerCase() + ' in ' + versus + ' versus ' + bef + ' ' + aft + ' ' + vversus.toLowerCase().indexOf(document.getElementById('pwd2').value.substring(ii).substring(0,1).toLowerCase()));
vversus=bef + ' ' + aft;
cowcount++;
document.getElementById('pwd2').placeholder+=String.fromCodePoint(128046); //' ';
//document.getElementById('player2').placeholder+=String.fromCodePoint(128046); //'🐂 ';
}
//document.getElementById('player2').value=document.getElementById('player2').placeholder;
document.getElementById('player2').value=document.getElementById('pwd2').placeholder;
}
//alert(document.getElementById('player2').placeholder);
document.getElementById('pwd2').title='' + bullcount + ' bull(s) and ' + cowcount + ' cow(s)';
document.getElementById('pwd2').value='';
vstwo='';
} else if (vstwo.length > versus.length && eval('' + vstwo.length) > 0 && eval('' + versus.length) > 0) {
//document.getElementById('player2').placeholder=document.getElementById('splayer2').innerHTML;
document.getElementById('player2').value=document.getElementById('pwd2').placeholder;
document.getElementById('pwd2').value='';
document.getElementById('pwd2').title='';
document.getElementById('pwd2').placeholder='';
vstwo="";
} else {
//document.getElementById('player2').value='';
document.getElementById('player2').value=bks.substring(0,vstwo.length).replace(/\ /g,'.'); //document.getElementById('pwd1').placeholder;
}
if (bullcount == eval('' + versus.length) && eval('' + versus.length) > 0) {
htmls[2]=sendmaybe(htmls[2].replace('</tbody>', '<tr><td colspan=3>' + 'Congratulations on guessing the word ... ' + versus + ' ... and your score jumps to ' + eval(score[2] + eval(versus.length)) + '</th></tr></tbody>'),2);
//score[1]+=eval('' + versus.length);
//ourscore[1]=score[1];
vstwo="";
document.getElementById('pwd1').value='';
document.getElementById('pwd1').title='';
document.getElementById('pwd1').placeholder='';
document.getElementById('pwd2').value='';
document.getElementById('pwd2').title='';
document.getElementById('pwd2').placeholder='';
//document.getElementById('player1').placeholder=document.getElementById('splayer1').innerHTML;
//document.getElementById('player2').placeholder=document.getElementById('splayer2').innerHTML;
document.getElementById('player1').value='';
document.getElementById('player2').value='';
//document.getElementById('summary1').innerHTML = ourname[1] + ourstatus[1] + "Score: " + score[1];
if (versus != "") {
activeplayer=2;
var prevscore=score[activeplayer];
score[activeplayer]+=eval(versus.length);
ourscore[activeplayer]=score[activeplayer];
//document.getElementById('summary' + activeplayer).innerHTML = ourname[activeplayer] + ourstatus[activeplayer] + "Score: " + score[activeplayer];
document.getElementById('summary' + activeplayer).innerHTML = document.getElementById('summary' + activeplayer).innerHTML.replace(document.getElementById('summary' + activeplayer).innerHTML.split(':')[0] + ': ' + prevscore, ourname[activeplayer] + ourstatus[activeplayer] + " Score: " + score[activeplayer]);
alert('Congratulations on guessing the word ... ' + versus);
}
versus="";
document.getElementById('myiframehastobe').src='/PHP/surprise.php?min=4&max=8&youllneverfindthis=y'; // + '&hastobe=' + wordguess.toLowerCase();
pfocus(); // document.getElementById('pwd2').focus();
} else if (eval('' + aguess.length) == eval('' + versus.length) && eval('' + versus.length) > 0) {
htmls[2]=sendmaybe(htmls[2].replace('</tbody>', '<tr><td><details><summary></summary>' + aguess.toLowerCase() + '</details></td><td>' + document.getElementById('pwd2').placeholder + '</td><td>' + document.getElementById('pwd2').title + '</td></tr></tbody>'),2);
}
pfocus(); // document.getElementById('pwd2').focus();
}
function sendmaybe(somehtml, inbignum) {
var bignum=Math.abs(inbignum), urlis='';
if (document.getElementById('splayer' + bignum).getAttribute('data-send') != '') {
if (document.getElementById('splayer' + bignum).getAttribute('data-send') == 'NEW' || (document.getElementById('splayer' + bignum).getAttribute('data-send') == 'new' && ('' + inbignum).indexOf('-') != -1)) {
if (wos[bignum]) {
if (!wos[bignum].closed) {
wos[bignum].close();
wos[bignum]=null;
}
}
//alert(htmls[bignum] + ' ... will become ... ' + somehtml);
wos[bignum]=window.open('','_blank','top=10,left=10,width=600,height=800');
if (('' + bignum) == '1') {
wos[bignum].document.write(somehtml.replace('Your Guess', player1 + ' Guess'));
} else {
wos[bignum].document.write(somehtml.replace(player1 + ' Guess', player2 + ' Guess').replace('Your Guess', player2 + ' Guess'));
}
} else if (document.getElementById('splayer' + bignum).getAttribute('data-send') == ' ' && ('' + inbignum).indexOf('-') != -1) { // sms
if (('' + bignum) == '1') {
urlis=document.URL.split('?')[0].split('#')[0] + '?htmlis=' + encodeURIComponent('<html><bo' + 'dy' + somehtml.replace('Your Guess', player1 + ' Guess').split('<bo' + 'dy')[1].replace(/\<details/g, '<details open'));
} else {
urlis=document.URL.split('?')[0].split('#')[0] + '?htmlis=' + encodeURIComponent('<html><bo' + 'dy' + somehtml.replace(player1 + ' Guess', player2 + ' Guess').replace('Your Guess', player2 + ' Guess').split('<bo' + 'dy')[1].replace(/\<details/g, '<details open'));
}
document.getElementById('asms').href=document.getElementById('asms').href.split('body=')[0].replace(':&',':' + document.getElementById('splayer' + bignum).getAttribute('data-sms') + '&') + 'body=' + encodeURIComponent(urlis);
document.getElementById('asms').click();
} else if (document.getElementById('splayer' + bignum).getAttribute('data-send') == ' ' && ('' + inbignum).indexOf('-') != -1) { // email via a mailto
if (document.getElementById('splayer' + bignum).title.indexOf('mailto') != -1) {
if (('' + bignum) == '1') {
urlis=document.URL.split('?')[0].split('#')[0] + '?htmlis=' + encodeURIComponent('<html><bo' + 'dy' + somehtml.replace('Your Guess', player1 + ' Guess').split('<bo' + 'dy')[1].replace(/\<details/g, '<details open'));
} else {
urlis=document.URL.split('?')[0].split('#')[0] + '?htmlis=' + encodeURIComponent('<html><bo' + 'dy' + somehtml.replace(player1 + ' Guess', player2 + ' Guess').replace('Your Guess', player2 + ' Guess').split('<bo' + 'dy')[1].replace(/\<details/g, '<details open'));
}
document.getElementById('aemail').href=document.getElementById('aemail').href.split('body=')[0].replace(':?',':' + document.getElementById('splayer' + bignum).getAttribute('data-email') + '?') + 'body=' + encodeURIComponent(urlis);
document.getElementById('aemail').click();
} else {
zhr = new XMLHttpRequest();
zform=new FormData();
zform.append('inline', '');
if (document.getElementById('splayer' + bignum).getAttribute('data-send').indexOf('@') != -1) {
zform.append('to', document.getElementById('splayer' + bignum).getAttribute('data-send'));
} else {
zform.append('to', document.getElementById('splayer' + bignum).getAttribute('data-email'));
}
zform.append('subject', 'Bulls and Cows game commentary ...');
if (('' + bignum) == '1') {
zform.append('htmlis', '<html><bo' + 'dy' + somehtml.replace('Your Guess', player1 + ' Guess').split('<bo' + 'dy')[1].replace(/\<details/g, '<details open'));
} else {
zform.append('htmlis', '<html><bo' + 'dy' + somehtml.replace(player1 + ' Guess', player2 + ' Guess').replace('Your Guess', player2 + ' Guess').split('<bo' + 'dy')[1].replace(/\<details/g, '<details open'));
}
zhr.open('post', '//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php', true);
zhr.send(zform);
//alert('not trying exim log look ' + aeto);
}
} else if (document.getElementById('splayer' + bignum).getAttribute('data-send').indexOf('@') != -1) { // email via PHP mail inline HTML
zhr = new XMLHttpRequest();
zform=new FormData();
zform.append('inline', '');
if (document.getElementById('splayer' + bignum).getAttribute('data-send').indexOf('@') != -1) {
zform.append('to', document.getElementById('splayer' + bignum).getAttribute('data-send'));
} else {
zform.append('to', document.getElementById('splayer' + bignum).getAttribute('data-email'));
}
zform.append('subject', 'Bulls and Cows game commentary ...');
if (('' + bignum) == '1') {
zform.append('htmlis', '<html><bo' + 'dy' + somehtml.replace('Your Guess', player1 + ' Guess').split('<bo' + 'dy')[1].replace(/\<details/g, '<details open'));
} else {
zform.append('htmlis', '<html><bo' + 'dy' + somehtml.replace(player1 + ' Guess', player2 + ' Guess').replace('Your Guess', player2 + ' Guess').split('<bo' + 'dy')[1].replace(/\<details/g, '<details open'));
}
zhr.open('post', '//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php', true);
zhr.send(zform);
}
}
return somehtml;
}
function addto(inletter) {
// This game, which can also be called “Mastermind” or “Jotto” involves one player thinking up a secret word of a set number of letters. The second player guesses a word; the first player tells them how many letters match
// in the right position (bulls) and how many letters are correct but in the wrong position (cows).
var bks=' ';
var bef='', aft='';
var bullcount=0;
var cowcount=0;
var vversus=versus;
document.getElementById('pwd1').value+=inletter;
var aguess=document.getElementById('pwd1').value;
if (document.getElementById('pwd1').value.length == versus.length && eval('' + document.getElementById('pwd1').value.length) > 0) {
document.getElementById('pwd1').placeholder='';
for (var ii=0; ii<versus.length; ii++) {
if (versus.substring(ii).substring(0,1).toLowerCase() == document.getElementById('pwd1').value.substring(ii).substring(0,1).toLowerCase()) {
bullcount++;
document.getElementById('pwd1').placeholder=String.fromCodePoint(128002) + document.getElementById('pwd1').placeholder; //'🐂 ';
//document.getElementById('player1').placeholder+=String.fromCodePoint(128002); //'🐂 ';
} else if (vversus.toLowerCase().indexOf(document.getElementById('pwd1').value.substring(ii).substring(0,1).toLowerCase()) != -1) {
bef='';
aft='';
if (vversus.toLowerCase().indexOf(document.getElementById('pwd1').value.substring(ii).substring(0,1).toLowerCase()) >= 0) {
bef=vversus.substring(0,vversus.toLowerCase().indexOf(document.getElementById('pwd1').value.substring(ii).substring(0,1).toLowerCase()));
}
if (eval(1 + vversus.toLowerCase().indexOf(document.getElementById('pwd1').value.substring(ii).substring(0,1).toLowerCase())) < eval('' + versus.length)) {
aft=vversus.substring(eval(1 + vversus.toLowerCase().indexOf(document.getElementById('pwd1').value.substring(ii).substring(0,1).toLowerCase())));
}
//alert(document.getElementById('pwd1').value + ' ... ' + document.getElementById('pwd1').value.substring(ii).substring(0,1).toLowerCase() + ' in ' + versus + ' versus ' + bef + ' ' + aft + ' ' + vversus.toLowerCase().indexOf(document.getElementById('pwd1').value.substring(ii).substring(0,1).toLowerCase()));
vversus=bef + ' ' + aft;
cowcount++;
document.getElementById('pwd1').placeholder+=String.fromCodePoint(128046); //' ';
//document.getElementById('player1').placeholder+=String.fromCodePoint(128046); //'🐂 ';
}
//document.getElementById('player1').value=document.getElementById('player1').placeholder;
document.getElementById('player1').value=document.getElementById('pwd1').placeholder;
}
document.getElementById('pwd1').title='' + bullcount + ' bull(s) and ' + cowcount + ' cow(s)';
document.getElementById('pwd1').value='';
if (bullcount == eval('' + versus.length) && eval('' + versus.length) > 0) {
htmls[1]=sendmaybe(htmls[1].replace('</tbody>', '<tr><td colspan=3>' + 'Congratulations on guessing the word ... ' + versus + ' ... and your score jumps to ' + eval(score[1] + eval(versus.length)) + '</th></tr></tbody>'),1);
//score[0]+=eval('' + versus.length);
//ourscore[0]=score[1];
vstwo="";
document.getElementById('pwd1').value='';
document.getElementById('pwd1').title='';
document.getElementById('pwd1').placeholder='';
document.getElementById('pwd2').value='';
document.getElementById('pwd2').title='';
document.getElementById('pwd2').placeholder='';
//document.getElementById('player1').placeholder=document.getElementById('splayer1').innerHTML;
//document.getElementById('player2').placeholder=document.getElementById('splayer2').innerHTML;
document.getElementById('player1').value='';
document.getElementById('player2').value='';
//document.getElementById('summary0').innerHTML = ourname[0] + ourstatus[0] + "Score: " + score[0];
if (versus != "") {
activeplayer=1;
var prevscore=score[activeplayer];
score[activeplayer]+=eval(versus.length);
ourscore[activeplayer]=score[activeplayer];
document.getElementById('summary' + activeplayer).innerHTML = document.getElementById('summary' + activeplayer).innerHTML.replace(document.getElementById('summary' + activeplayer).innerHTML.split(':')[0] + ': ' + prevscore, ourname[activeplayer] + ourstatus[activeplayer] + " Score: " + score[activeplayer]);
alert('Congratulations on guessing the word ... ' + versus);
}
versus="";
document.getElementById('myiframehastobe').src='/PHP/surprise.php?min=4&max=8&youllneverfindthis=y'; // + '&hastobe=' + wordguess.toLowerCase();
pfocus(); // document.getElementById('pwd2').focus();
} else if (eval('' + aguess.length) == eval('' + versus.length) && eval('' + versus.length) > 0) {
htmls[1]=sendmaybe(htmls[1].replace('</tbody>', '<tr><td><details><summary></summary>' + aguess.toLowerCase() + '</details></td><td>' + document.getElementById('pwd1').placeholder + '</td><td>' + document.getElementById('pwd1').title + '</td></tr></tbody>'),1);
}
pfocus(); // document.getElementById('pwd2').focus();
//alert(' guesses ' + document.getElementById('pwd1').value);
} else if (document.getElementById('pwd1').value.length > versus.length && eval('' + document.getElementById('pwd1').value.length) > 0 && eval('' + versus.length) > 0) {
//document.getElementById('player1').value='';
//document.getElementById('player1').placeholder=document.getElementById('splayer1').innerHTML;
document.getElementById('player1').value=document.getElementById('pwd1').placeholder;
document.getElementById('pwd1').value='';
document.getElementById('pwd1').title='';
document.getElementById('pwd1').placeholder='';
} else {
//document.getElementById('player1').value='';
//document.getElementById('player1').value=document.getElementById('splayer1').innerHTML;
document.getElementById('player1').value=bks.substring(0,document.getElementById('pwd1').value.length).replace(/\ /g,'.'); //document.getElementById('pwd1').placeholder;
}
if (1 == 5) {
document.getElementById('whatyouhavesofar').innerHTML+=inletter;
if (thewordtoguess.toLowerCase().indexOf(inletter) == -1) document.getElementById('whatyouhavesofar').innerHTML='';
if (document.getElementById('whatyouhavesofar').innerHTML.length == letters.length) {
lwg=document.getElementById('whatyouhavesofar').innerHTML.toLowerCase();
thegames(1);
}
}
}
function wordingcheck() {
var htmlis=location.search.split('htmlis=')[1] ? decodeURIComponent(location.search.split('htmlis=')[1].split('&')[0]).replace(/\+/g,' ') : '';
if (htmlis != '') {
wos[0]=window.open('','_blank','left=10,top=10,width=600,height=800');
wos[0].document.write(htmlis);
window.close();
return '';
}
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
//document.getElementById('myh1').innerHTML=document.getElementById('myh1').innerHTML.replace("Keyboard", "Long Touch");
document.getElementById('myh1').innerHTML=document.getElementById('myh1').innerHTML.replace(" Mouse and One at Keyboard", " Touch on Blue and One on Touch Away from Blue");
document.getElementById('summary1').innerHTML=document.getElementById('summary1').innerHTML.replace("on mouse", "with touch on blue");
document.getElementById('summary2').innerHTML=document.getElementById('summary2').innerHTML.replace("at keyboard", "with touch away from blue");
cstatus=", ... with touch on blue ... , ... with touch away from blue ... ";
} else {
}
player1=location.search.split('player1=')[1] ? (decodeURIComponent(location.search.split('player1=')[1].split('&')[0]).replace(/\+/g,' ') == 'Player 1' ? ourprompt('Enter Player 1 name (and optionally comma separate Player 2 name)' + esblurb,decodeURIComponent(location.search.split('player1=')[1].split('&')[0]).replace(/\+/g,' ')) : decodeURIComponent(location.search.split('player1=')[1].split('&')[0]).replace(/\+/g,' ')) : "Player 1";
player2='';
if (player1.indexOf(',') != -1) { player2=player1.replace(player1.split(',')[0] + ',',''); player1=player1.split(',')[0]; } else {
player2=location.search.split('player2=')[1] ? (decodeURIComponent(location.search.split('player2=')[1].split('&')[0]).replace(/\+/g,' ') == 'Player 2' ? ourprompt('Enter Player 2 name' + esblurb,decodeURIComponent(location.search.split('player2=')[1].split('&')[0]).replace(/\+/g,' ')) : decodeURIComponent(location.search.split('player2=')[1].split('&')[0]).replace(/\+/g,' ')) : "Player 2";
}
htmls[2]=htmls[1].replace('Your Guess',player2 + ' Guess').replace('Player 1 Guess',player2 + ' Guess');
htmls[1]=htmls[1].replace('Your Guess',player1 + ' Guess').replace('Player 1 Guess',player1 + ' Guess');
cname="," + player1 + "," + player2;
if (player1 != "Player 1") document.getElementById('summary1').innerHTML=document.getElementById('summary1').innerHTML.replace("Player 1", player1);
if (player2 != "Player 2") document.getElementById('summary2').innerHTML=document.getElementById('summary2').innerHTML.replace("Player 2", player2);
document.getElementById('player1').value=player1;
document.getElementById('player2').value=player2;
if (player1 != "Player 1") {
document.getElementById('splayer1').innerHTML=player1;
document.getElementById('player1').placeholder=player1;
}
if (player2 != "Player 2") {
document.getElementById('splayer2').innerHTML=player2;
document.getElementById('player2').placeholder=player2;
}
//alert(document.getElementById('player2').value);
}
function ourprompt(inb, indef) {
var thisconduit='';
var retv=window.prompt(inb, indef);
if (retv == null) { retv=''; }
var rtvs=retv.split(',');
for (var ir=0; ir<rtvs.length; ir++) {
if (rtvs[ir].indexOf('[newwindow]') != -1) {
document.getElementById('splayer' + ourpgoes).setAttribute('data-send', 'new');
retv=retv.replace('[newwindow]', '');
document.getElementById('splayer' + ourpgoes).title='Click me when you want to open commentary popup window';
document.getElementById('splayer' + ourpgoes).onclick=function(event) { sendmaybe(htmls[eval(event.target.id.substring(7))],eval('-' + event.target.id.substring(7))); };
document.getElementById('splayer' + ourpgoes).style.cursor='pointer';
} else if (rtvs[ir].indexOf('[new window]') != -1) {
document.getElementById('splayer' + ourpgoes).setAttribute('data-send', 'new');
retv=retv.replace('[new window]', '');
document.getElementById('splayer' + ourpgoes).title='Click me when you want to open commentary popup window';
document.getElementById('splayer' + ourpgoes).onclick=function(event) { sendmaybe(htmls[eval(event.target.id.substring(7))],eval('-' + event.target.id.substring(7))); };
document.getElementById('splayer' + ourpgoes).style.cursor='pointer';
} else if (rtvs[ir].indexOf('[NEWWINDOW]') != -1) {
document.getElementById('splayer' + ourpgoes).setAttribute('data-send', 'NEW');
retv=retv.replace('[NEWWINDOW]', '');
document.getElementById('splayer' + ourpgoes).title='Continuous commentary popups being sent';
} else if (rtvs[ir].indexOf('[NEW WINDOW]') != -1) {
document.getElementById('splayer' + ourpgoes).setAttribute('data-send', 'NEW');
retv=retv.replace('[NEW WINDOW]', '');
document.getElementById('splayer' + ourpgoes).title='Continuous commentary popups being sent';
} else if (rtvs[ir].indexOf('@') != -1) {
if (rtvs[ir].indexOf('[') != -1) {
thisconduit=rtvs[ir].split('[')[1].split(']')[0];
if (thisconduit == thisconduit.toUpperCase()) {
document.getElementById('splayer' + ourpgoes).setAttribute('data-send', thisconduit);
document.getElementById('splayer' + ourpgoes).title='Continuous commentary PHP mail inline HTML emails being sent to ' + thisconduit;
retv=retv.replace('[' + thisconduit + ']','');
} else {
if (thisconduit == thisconduit.toLowerCase()) {
document.getElementById('splayer' + ourpgoes).title='Click me when you want to send a mailto email to ' + thisconduit;
retv=retv.replace('[' + thisconduit + ']','');
} else {
document.getElementById('splayer' + ourpgoes).title='Click me when you want to send PHP mail inline HTML email to ' + thisconduit;
retv=retv.replace('[' + thisconduit + ']','');
}
document.getElementById('splayer' + ourpgoes).style.cursor='pointer';
document.getElementById('splayer' + ourpgoes).setAttribute('data-send', ' ');
document.getElementById('splayer' + ourpgoes).setAttribute('data-email', thisconduit);
document.getElementById('splayer' + ourpgoes).onclick=function(event) { sendmaybe(htmls[eval(event.target.id.substring(7))],eval('-' + event.target.id.substring(7))); };
}
} else if (rtvs[ir] == rtvs[ir].toUpperCase()) {
document.getElementById('splayer' + ourpgoes).setAttribute('data-send', rtvs[ir]);
} else {
if (rtvs[ir] == rtvs[ir].toLowerCase()) {
document.getElementById('splayer' + ourpgoes).title='Click me when you want to send a mailto email to ' + rtvs[ir];
} else {
document.getElementById('splayer' + ourpgoes).title='Click me when you want to send PHP mail inline HTML email to ' + rtvs[ir];
}
document.getElementById('splayer' + ourpgoes).style.cursor='pointer';
document.getElementById('splayer' + ourpgoes).setAttribute('data-send', ' ');
document.getElementById('splayer' + ourpgoes).setAttribute('data-email', rtvs[ir]);
document.getElementById('splayer' + ourpgoes).onclick=function(event) { sendmaybe(htmls[eval(event.target.id.substring(7))],eval('-' + event.target.id.substring(7))); };
}
} else if (rtvs[ir].replace('[9','[0').replace('[8','[0').replace('[7','[0').replace('[6','[0').replace('[5','[0').replace('[4','[0').replace('[3','[0').replace('[2','[0').replace('[1','[0').indexOf('[0') != -1) {
thisconduit=rtvs[ir].split('[')[1].split(']')[0];
document.getElementById('splayer' + ourpgoes).title='Click me when you want to send SMS to ' + thisconduit;
retv=retv.replace('[' + thisconduit + ']','');
document.getElementById('splayer' + ourpgoes).style.cursor='pointer';
document.getElementById('splayer' + ourpgoes).setAttribute('data-send', ' ');
document.getElementById('splayer' + ourpgoes).setAttribute('data-sms', thisconduit);
document.getElementById('splayer' + ourpgoes).onclick=function(event) { sendmaybe(htmls[eval(event.target.id.substring(7))],eval('-' + event.target.id.substring(7))); };
}
ourpgoes++;
}
return retv;
}
function nothing() {
if (1 == 2) alert(987);
}
function valplace() {
if (document.getElementById('splayer1').innerHTML != '') { document.getElementById('player1').value=document.getElementById('splayer1').innerHTML.replace('Player 1 Name','Player 1'); }
if (document.getElementById('splayer2').innerHTML != '') { document.getElementById('player2').value=document.getElementById('splayer2').innerHTML.replace('Player 2 Name','Player 2'); }
return true;
}
function onl() {
if (window.self !== window.top) {
document.body.innerHTML+=' <sty' + 'le> .tablek { text-align: right; } .tablem { text-align: left; } #pwd1 { width:50%; text-align:right; } #pwd2 { width:50%; text-align:left; } input[type=password] { font-size: 24px; } </sty' + 'le> ';
}
}
</script>
</head>
<body onload='wordingcheck(); onl();' style='width:99%;background-color:#f0f0f0;' onclick=" document.title='Click'; if (!inalready) { inalready=true; setTimeout(thegames1,1000); } " ontouchstart=" document.title='Ontouchstart'; if (!inalready) { inalready=true; setTimeout(thegames2,1000); } " onkeydown=" document.title='Keyboard'; if (!inalready) { inalready=true; setTimeout(thegames2,1000); } ">
<h1 id='myh1' align='center'><span title='Letter correct and in correct position'>Bulls</span> 🐂 <a href='https://www.dailywritingtips.com/list-50-word-games/' target=_blank title='Useful word game list explaining Bulls and Cows game rules, thanks'>&</a> 🐮 <span title='Letter exists in word but not where you specified'>Cows</span> <span title='We give up ... new word please, on click.' id=nw onclick=neww();> English</span> Word Guessing Game for Two - One on Mouse & One at Keyboard</h1>
<h3 id='myh3' align='center'>RJM Programming - December, 2022</h3>
<table style='width:99%; border: 3px solid purple;' onclick=" document.title='Click'; if (!inalready) { inalready=true; setTimeout(thegames1,1000); } " ontouchstart=" document.title='Ontouchstart'; if (!inalready) { inalready=true; setTimeout(thegames2,1000); } " onkeydown=" document.title='Keyboard'; if (!inalready) { inalready=true; setTimeout(thegames2,1000); } ">
<tr><th style='background-color:lightgreen;' onclick=" document.title='Click'; if (!inalready) { inalready=true; setTimeout(thegames1,1000); } " ontouchstart=" document.title='Click'; if (!inalready) { inalready=true; setTimeout(thegames1,1000); } " onkeydown=" document.title='Keyboard'; if (!inalready) { inalready=true; setTimeout(thegames2,1000); } "><span id='summary1'>Player 1 ... on mouse ... Score: 0</span><br><br>Letters below are clickable<br><br>
<table id=tablel align='center' style='background-color:yellow;'><tr><td class=tablek id=tcell>
<h1 onclick="addto('q');" ontouchstart="nothing();" class='aq cell'></h1>
<h1 onclick="addto('w');" ontouchstart="nothing();" class='aw cell'></h1>
<h1 onclick="addto('e');" ontouchstart="nothing();" class='ae cell'></h1>
<h1 onclick="addto('r');" ontouchstart="nothing();" class='ar cell'></h1>
<h1 onclick="addto('t');" ontouchstart="nothing();" class='at cell'></h1>
<h1 onclick="addto('y');" ontouchstart="nothing();" class='ay cell'></h1>
<h1 onclick="addto('u');" ontouchstart="nothing();" class='au cell'></h1>
<h1 onclick="addto('i');" ontouchstart="nothing();" class='ai cell'></h1>
<h1 onclick="addto('o');" ontouchstart="nothing();" class='ao cell'></h1>
<h1 onclick="addto('p');" ontouchstart="nothing();" class='ap cell'></h1></td><tr><td class=tablek>
<h1 onclick="addto('a');" ontouchstart="nothing();" class='aa cell'></h1>
<h1 onclick="addto('s');" ontouchstart="nothing();" class='as cell'></h1>
<h1 onclick="addto('d');" ontouchstart="nothing();" class='ad cell'></h1>
<h1 onclick="addto('f');" ontouchstart="nothing();" class='af cell'></h1>
<h1 onclick="addto('g');" ontouchstart="nothing();" class='ag cell'></h1>
<h1 onclick="addto('h');" ontouchstart="nothing();" class='ah cell'></h1>
<h1 onclick="addto('j');" ontouchstart="nothing();" class='aj cell'></h1>
<h1 onclick="addto('k');" ontouchstart="nothing();" class='ak cell'></h1>
<h1 onclick="addto('l');" ontouchstart="nothing();" class='al cell'></h1><tr><td class=tablek>
<h1 onclick="addto('z');" ontouchstart="nothing();" class='az cell'></h1>
<h1 onclick="addto('x');" ontouchstart="nothing();" class='ax cell'></h1>
<h1 onclick="addto('c');" ontouchstart="nothing();" class='ac cell'></h1>
<h1 onclick="addto('v');" ontouchstart="nothing();" class='av cell'></h1>
<h1 onclick="addto('b');" ontouchstart="nothing();" class='ab cell'></h1>
<h1 onclick="addto('n');" ontouchstart="nothing();" class='an cell'></h1>
<h1 onclick="addto('m');" ontouchstart="nothing();" class='am cell'></h1>
<br><br><input type=password id=pwd1 value='' readonly></input></td></tr></table><br><br>
<h4 id='whatyouhavesofar'></h4>
</th><th style='background-color:lightgray;'><span id=numletters></span>
<form onsubmit='return valplace();' method='GET' action='./bullsandcows.html'>
<span id=splayer1 data-send=''>Player 1 Name</span> <input onclick='inalready=true; nothing();' onkeydown='inalready=true; nothing();' ontouchstart='inalready=true; nothing();' type='text' id='player1' name='player1' value='' placeholder='Player 1'></input><br><br>
<span id=splayer2 data-send=''>Player 2 Name</span> <input onclick='inalready=true; nothing();' onkeydown='inalready=true; nothing();' ontouchstart='inalready=true; nothing();' type='text' id='player2' name='player2' value='' placeholder='Player 2'></input><br><br>
<input onclick='inalready=true; nothing();' onkeydown='inalready=true; nothing();' ontouchstart='inalready=true; nothing();' type='submit' value='Rename Players or Commentary'></input>
</form>
</th><th class=tablem id='summary2' style='background-color:lightblue;'>Player 2 ... at keyboard ... Score: 0<br><br><input onblur="vstwo=this.value; assesstwo();" onkeydown=pwdonkd(event); type=password id=pwd2 onfocus=siv(); value=''></input></td></th></tr>
</table>
<div onclick=" document.title='Click'; if (!inalready) { inalready=true; setTimeout(thegames1,1000); } " ontouchstart=" document.title='Ontouchstart'; if (!inalready) { inalready=true; setTimeout(thegames2,1000); } " onkeydown=" document.title='Keyboard'; if (!inalready) { inalready=true; setTimeout(thegames2,1000); } " align='center' id='thewordtoguess' style='display:none;width:99%; background-color: pink; padding-top: 40px; padding-bottom: 40px;'><table style='width:99%;height:20px;'><tr style='width:99%;'><td id='letter1' style='display:none;'></td><td id='letter2' style='display:none;'></td><td id='letter3' style='display:none;'></td><td id='letter4' style='display:none;'></td><td id='letter5' style='display:none;'></td><td id='letter6' style='display:none;'></td><td id='letter7' style='display:none;'></td><td id='letter8' style='display:none;'></td></tr></table></div>
<iframe id='myiframe' style='display:none;' src='/PHP/surprise.php?min=4&max=8&youllneverfindthis=y#whatever=1' onload=' iframecheck(this); '></iframe>
<iframe id='myiframehastobe' style='display:none;' src='/PHP/surprise.php?min=4&max=8&youllneverfindthis=y' onload=' iframeverify(this); '></iframe>
<iframe id='myiframeprogress' style='display:none;' src=''></iframe>
<a target=_blank id=aemail style=display:none; href='mailto:?subject=Bulls%20and%20Cows%20game%20...&body='>Email</a><a target=_blank id=asms style=display:none; href='sms:&body='>SMS</a>
<div style='width:99%; height: 600px; overflow: hidden;'></div>
</body>
</html>