<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Match Word Techniques - RJM Programming - May, 2017 ... Thanks to Text Types in English by Mark Anderson and Kathy Anderson (ISBN: 0-7329-4584-4) p. 72-74</title>
<link href='//www.rjmprogramming.com.au/PHP/emboss_h1.css' rel='stylesheet' type='text/css'>

<script type='text/javascript'>
var done=false, which=-1, cando=true, extras='', extradelim='', seconds=0, thislist="", thisdelim="", oisvalue='';

// Thanks to Text Types in English p. 72-74
var characteristic = ["alliteration;the use of the same letter or sound in two or more words that are close together. It is indicated by repeated consonants.",
"antonym;a word that has the opposite meaning to another",
"assonance;the use of the same letter or sound in words that are close together. It is indicated by repeated vowels or vowel sounds.",
"compound word;a word made up by putting two or more existing words together",
"colloquialism;a word used in everyday writing or speech, as opposed to formal or literary texts",
"ephemism;a word or phrase used to communicate an idea in a polite or less direct way",
"gerund;a verb that functions as a noun",
"homonym;a word with the same spelling as another, but with a different meaning",
"homophone;a word that sounds the same as another but has a different meaning",
"jargon;the use of words that are particular to a specific subject or occupation",
"neologism;a new word or expression in a language",
"onomatopoeia;the use of words that sound like the action they represent",
"palindrome;a word or phrase that reads the same backwards as forwards",
"personification;the use of words, usually verbs, that are associated with people to describe non-human things",
"pun;the use of one word to suggest different meanings",
"rhyme;the sound of two or more words matching",
"slang;words that are not accepted in 'formal' English",
"solecism;the mispronunciation of a word that relates to technical language, or jargon",
"synonym;a word that has a similar meaning to another"];
var sentencephrase = ["Around the rugged rocks the ragged rascal ran.",
"hot versus cold, tall versus short",
"I lie here and cry, my eyes like fires.",
"goldfish, footpath",
"'undies' for underpants, 'get flogged for' for beaten in a game",
"'the bathroom' for toilet, 'passed away' for died",
"she likes drinking, swimming is good for you",
"Come and wave goodbye to Grandma. She surfed wave after wave.",
"flour and flower, sail and sale",
"'slips' in cricket, 'starboard' in sailing",
"'fax' for facsimile machine, 'modem' for modulator plus demodulator",
"the hiss of a snake, the click of his fingers",
"radar, mum",
"The dam wall, tired of holding back the water, crumbled. The oak tree, standing tall, shed lots of leaves.",
"Why did the teacher need glasses? Because he couldn't control his pupils.",
"right and light, day and way",
"'crook' for sick, 'what a bummer' for that was bad luck",
"'Boats-wain' for boatswain (pronounced bo-sun), 'mid-wife-ery' for midwifery (pronounced mid-wiffery)",
"stop and halt, neat and tidy",
"bloodhound, campground"
];

var sentencephrase_0 = [characteristic[0].split(";")[0]];
var sentencephrase_1 = [characteristic[1].split(";")[0]];
var sentencephrase_2 = [characteristic[2].split(";")[0]];
var sentencephrase_3 = [characteristic[3].split(";")[0]];
var sentencephrase_4 = [characteristic[4].split(";")[0]];
var sentencephrase_5 = [characteristic[5].split(";")[0]];
var sentencephrase_6 = [characteristic[6].split(";")[0]];
var sentencephrase_7 = [characteristic[7].split(";")[0]];
var sentencephrase_8 = [characteristic[8].split(";")[0]];
var sentencephrase_9 = [characteristic[9].split(";")[0]];
var sentencephrase_10 = [characteristic[10].split(";")[0]];
var sentencephrase_11 = [characteristic[11].split(";")[0]];
var sentencephrase_12 = [characteristic[12].split(";")[0]];
var sentencephrase_13 = [characteristic[13].split(";")[0]];
var sentencephrase_14 = [characteristic[14].split(";")[0]];
var sentencephrase_15 = [characteristic[15].split(";")[0]];
var sentencephrase_16 = [characteristic[16].split(";")[0]];
var sentencephrase_17 = [characteristic[17].split(";")[0]];
var sentencephrase_18 = [characteristic[18].split(";")[0]];
var sentencephrase_19 = [characteristic[3].split(";")[0],characteristic[15].split(";")[0]];

var nsentencephrase = sentencephrase.length;
var numwords = 0;
var easnames = [];
var score = 0;
var goes = 0;
var iinext = 20, ina="", isok=true;

var emailee = (location.search.split('emailee=')[1] ? decodeURIComponent(location.search.split('emailee=')[1].split('&')[0]) : 'fill.in@email.to');
var mores = (location.search.split('wawclues=')[1] ? decodeURIComponent(location.search.split('wawclues=')[1].split('&')[0]) : '');
var prevscore = (location.search.split('prevscore=')[1] ? (" versus " + decodeURIComponent(location.search.split('prevscore=')[1].split('&')[0]).replace(' over ',' from ')) : '');
var prevlist = (location.search.split('prevlist=')[1] ? decodeURIComponent(location.search.split('prevlist=')[1].split('&')[0]) : '');
var ninehundred=location.search.split('ninehundred=')[1] ? eval(decodeURIComponent(location.search.split('ninehundred=')[1].split('&')[0])) : 900;

if (mores.indexOf('@') != -1 && emailee == 'fill.in@email.to') {
emailee=mores.split('~')[0];
if (mores.indexOf("~") != -1) {
isok=false;
setTimeout(ath,2000);
}
}

function ath() {
isok=true;
}

function waw_setCookie(thisg) { // thanks to JavaScript and Ajax by Tom Negrino and Dori Smith
var expireDate = new Date();
var prefix="";
if (emailee.indexOf('@') != -1 && emailee != 'fill.in@email.to') {
if (thisg.indexOf(emailee) == -1) {
thisg=thisg.split('~')[eval(-1 + thisg.split('~').length)];
if (thisg == "") {
prefix=emailee;
} else {
prefix=emailee + "~";
}
}
}
expireDate.setMonth(expireDate.getMonth()+6);
//alert(thisg);
if (("wawclues=" + encodeURIComponent(prefix + thisg) + "; expires=" + expireDate.toGMTString()).length < ninehundred) {
document.cookie = "wawclues=" + encodeURIComponent(prefix + thisg) + "; expires=" + expireDate.toGMTString();
}
}

function waw_deleteCookie() { // thanks to JavaScript and Ajax by Tom Negrino and Dori Smith
var expireDate = new Date();
expireDate.setMonth(expireDate.getMonth()-6);
document.cookie = "wawclues=; expires=" + expireDate.toGMTString();
}

function waw_cookieVal(firstcall) {
if (firstcall && mores != '') {
if (document.cookie == '') {
extras=mores.replace('~!','~');
waw_setCookie(mores);
}
} else {
if (document.cookie != '') {
//alert(9);
var tCookie=document.cookie.split("; ");
for (var j=0; j<tCookie.length; j++) {
if ("wawclues" == tCookie[j].split("=")[0]) {
if (firstcall && decodeURIComponent(tCookie[j].split("=")[1]) != "") {
//document.title=tCookie[j];
//alert(emailee + ' ... ' + decodeURIComponent(tCookie[j].split("=")[1]));
if (decodeURIComponent(tCookie[j].split("=")[1]).indexOf('@') != -1) {
if (emailee.indexOf('@') == -1 || emailee == 'fill.in@email.to') {
emailee=decodeURIComponent(tCookie[j].split("=")[1]).split('~')[0];
//alert(emailee);
} //else {
//alert(98);
//}
}
if (decodeURIComponent(tCookie[j].split("=")[1]).split('~')[eval(-1 + decodeURIComponent(tCookie[j].split("=")[1]).split('~').length)].indexOf('|') != -1) {
//alert(1122);
preaddthis(decodeURIComponent(tCookie[j].split("=")[1]).split('~')[eval(-1 + decodeURIComponent(tCookie[j].split("=")[1]).split('~').length)]);
}
}
return decodeURIComponent(tCookie[j].split("=")[1]);
}
}
}
}
return '';
}

function check(bis) {
var plusbit = 0, jj, mm, oois, wealsothink = "", wedonotthink = "";
goes = goes + 1;
//alert(bis.id);
var sisvalue = document.getElementById(bis.id.replace("i_", "s_")).value;
var asis = sisvalue.split(";");
if (asis.length <= 1) return;
//alert(asis[1] + ' ... ' + sisvalue);
var allwordtechniques = asis[1].split(",");
sisvalue = sisvalue.replace(asis[0] + ";", ",") + ",";
var proposedurl = "http://www.thefreedictionary.com/" + asis[1].replace("-1", "").replace("-2", "").replace(" ", "+").replace(" ", "+");
//alert(sisvalue);
var radis = document.getElementsByName(bis.id.replace("i_", "r_"));
var radvalue = '';
for (var i = 0, length = radis.length; i < length; i++) {
if (radis[i].checked) {
radvalue = radis[i].value;
if (sisvalue.indexOf("," + radvalue + ",") != -1) {
if (sisvalue.indexOf("-2") != -1) {
plusbit = eval(plusbit + 2);
} else {
plusbit = eval(plusbit + 1);
}
for (mm=0; mm<allwordtechniques.length; mm++) {
if (radvalue == allwordtechniques[mm]) allwordtechniques[mm] = '';
}
} else if (wedonotthink == "") {
wedonotthink = "We do not think the following word techniques work with " + asis[0] + ": " + radvalue + " " + however(radvalue);
} else {
wedonotthink = wedonotthink + ", " + radvalue + " " + however(radvalue);
}
}
}

if (wedonotthink != "") wedonotthink = wedonotthink + ". ";

if (plusbit < allwordtechniques.length) {

for (mm=0; mm<allwordtechniques.length; mm++) {
if (allwordtechniques[mm] != "") {
if (wealsothink == "") {
wealsothink = "We think the following word techniques could also work with " + asis[0] + ": " + allwordtechniques[mm] + " " + however(allwordtechniques[mm]);
} else {
wealsothink = wealsothink + ", " + allwordtechniques[mm] + " " + however(allwordtechniques[mm]);
}
}
}
wealsothink = wealsothink + ". ";
}

score = eval(score + plusbit);
//document.getElementById('score').innerHTML = "Score: " + score + " from " + goes + " goes";
var ovbits=document.getElementById('score').innerHTML.split(' over ');
//alert(document.getElementById('whatisleft' + eval(1 + whichrow)).innerHTML + ' vs ' + thedefaults[which].answers[whichrow]);
if (ovbits.length > 1) {
document.getElementById('score').innerHTML='Score: ' + score + '/' + goes + ' over ' + ovbits[1];
} else {
document.getElementById('score').innerHTML='Score: ' + score + '/' + goes;
}

if (plusbit == 0) {
var maybe = prompt(wealsothink + wedonotthink + "If you want to see a dictionary lookup press OK button. " + however(asis[1].replace("-1", "").replace("-2", "")), asis[1].replace("-1", "").replace("-2", ""));
if (maybe != null) {
if (maybe.replace(" ", "+").replace(" ", "+") == asis[1].replace("-1", "").replace("-2", "").replace(" ", "+").replace(" ", "+")) {
window.open(proposedurl, asis[1].replace("-1", "").replace("-2", "").replace(" ", "+").replace(" ", "+"), "top=20,left=20,width=800,height=600");
}
}
} else if (wedonotthink != "" && wealsothink != '') {
alert("It did not stop you scoring, but ... " + wealsothink + wedonotthink);
} else if (wedonotthink != "") {
alert("It didn't stop you scoring, but ... " + wedonotthink);
} else if (wealsothink != "") {
alert("It didn't stop you scoring, but " + wealsothink);
}

//oois = document.getElementById("s_sentencephrase");
//oois.value = easnames[Math.floor(Math.random() * numwords) + 0];
setTimeout(delayit,500);
}

function however(idea) {
var ii, retval="";
for (ii=0; ii<characteristic.length; ii++) {
if (characteristic[ii].indexOf(idea + ";") == 0) retval=String.fromCharCode(10) + idea.substring(0,1).toUpperCase() + idea.substring(1) + ': ' + characteristic[ii].split(';')[1];
}
return retval;
}


function writeItOut() {
var xextras=[], ixextras, sparea=[], i = 0, afirstcall=true, j = 0, k = 0, m = 0, ois, selbit = '', selbit = '', thisdiv = '', myarr = [], myword = [], answerword = [], thisrb = "", sentencephrasecell = "<td>", advancedcell = "<td>";



if (mores != "") {
//alert(mores);
if (mores.indexOf('@') != -1) {
emailee=mores.split('~')[0];
if (emailee.indexOf('@') != -1 && emailee != 'fill.in@email.to') {
if (extras == "") {
//document.title=emailee;
extras=emailee;
extradelim="~";
document.getElementById('emailee').value=emailee;
document.getElementById('aemail').href='mailto:' + emailee + '?' + document.getElementById('aemail').href.split('?')[1];
waw_setCookie(extras.replace('~!','~'));
} else if (extras.indexOf(emailee) != 0) {
//document.title='1103' + ' ' + emailee;
document.getElementById('emailee').value=emailee;
document.getElementById('aemail').href='mailto:' + emailee + '?' + document.getElementById('aemail').href.split('?')[1];
var spare=emailee + "~" + extras.split('~')[eval(-1 + extras.split('~').length)];
extras=spare.replace('~!','~');
}
}
}
waw_setCookie(mores.replace('~!','~'));
xextras=mores.replace('~!','~').split('!');
//alert(xextras.length);
mores="";
for (ixextras=0; ixextras<xextras.length; ixextras++) {
if (document.URL.indexOf('wawclues=') == -1) {
preaddthis(xextras[ixextras].split('~')[eval(-1 + xextras[ixextras].split('~').length)]);
//alert(xextras[ixextras].split('~')[eval(-1 + xextras[ixextras].split('~').length)]);
}
}
if (document.URL.indexOf('wawclues=') == -1) {
xextras=[];
}
} else if (afirstcall && document.URL.indexOf('wawclues=') == -1) {
//alert(1100);
waw_cookieVal(afirstcall);
afirstcall=false;
}
afirstcall=false;
if (which < 0) {
which=maybewhich(Math.floor(Math.random() * sentencephrase.length));
}


var esnames = new Array(nsentencephrase);
var tstr = "<table style='width:100%;text-align:center;background-color: lightgreen;' border=5 cellpadding=5 cellspacing=5><tbody id='wctbody'><tr style='background-color: pink;'><th>Word Technique (1 point per correct matching word technique)</th></tr><tr><td>";
thisrb = "<form action='' id='f_sentencephrase' name='f_sentencephrase'>";
//sentencephrase.sort();
for (i=1; i<=characteristic.length; i++) {
if ((i % 5) == 0) {
thisrb = thisrb + "<input type='checkbox' name='r_sentencephrase' title='" + characteristic[i - 1].split(";")[1] + "' value='" + characteristic[i - 1].split(";")[0] + "'>" + characteristic[i - 1].split(";")[0] + "<br>";
} else {
thisrb = thisrb + "<input type='checkbox' name='r_sentencephrase' title='" + characteristic[i - 1].split(";")[1] + "' value='" + characteristic[i - 1].split(";")[0] + "'>" + characteristic[i - 1].split(";")[0];
}
}
thisrb = thisrb + "</form><br><br>  <input style='background-color:yellow;' id='i_sentencephrase' type='button' onclick='check(this);' value='Check word techniques above with phrase(s) and/or sentence(s) below'></input>";
thisdiv = "<div id='sentencephrase' style='border: 2px solid green;'>" + thisrb + "</div>";
tstr = tstr + thisdiv;
selbit = "<br><br>  <select id='s_sentencephrase'></select><br><br>"
for (i=0; i<nsentencephrase; i++) {
if (sentencephrase[i].indexOf('|') != -1) {
//alert(sentencephrase[i].split('|')[1]);
sparea = [];
for (var ij=0; ij<sentencephrase[i].split('|')[1].split(',').length; ij++) {
//alert(sentencephrase[i].split('|')[1].split(',')[ij]);
sparea.push(sentencephrase[i].split('|')[1].split(',')[ij]);
}
esnames[i] = "sparea"; //sentencephrase[i].replace(" ", "_");
} else {
esnames[i] = "sentencephrase_" + i; //sentencephrase[i].replace(" ", "_");
}
//alert(esnames[i] + thisrb);
for (j=0; j<eval(esnames[i] + ".length"); j++) {
myarr[j] = eval(esnames[i] + "[" + j + "]");
//alert("myarr[j]=" + myarr[j] + ":" + selbit);
if (selbit.indexOf(">" + sentencephrase[i].split('|')[0] + "<") != -1) {
for (m=0; m<k; m++) {
if (easnames[m].indexOf(sentencephrase[i].split('|')[0] + ";") != -1) {
selbit = selbit.replace("\"" + sentencephrase[i].split('|')[0] + ";", "\"" + sentencephrase[i].split('|')[0] + ";" + myarr[j] + ",");
easnames[m] = easnames[m].replace(sentencephrase[i].split('|')[0] + ";", sentencephrase[i].split('|')[0] + ";" + myarr[j] + ",");
//alert("m:" + easnames[m]);
}
}
} else {
selbit = selbit.replace("</select>", "<option value=\"" + sentencephrase[i].split('|')[0] + ";" + myarr[j] + "\">" + sentencephrase[i].split('|')[0] + "</option></select>");
easnames[k] = sentencephrase[i].split('|')[0] + ";" + myarr[j];
//alert(easnames[k]);
k = eval(k + 1);
}

}


}
tstr = tstr.replace("</div>", selbit.replace("</select>", "<option selected value=></option></select>") + "</td></div>");


if (xextras.length >= 1) {
//alert(65);
if (xextras[0] != "") {
//alert(which);
for (ixextras=0; ixextras<xextras.length; ixextras++) {
if (document.URL.indexOf('wawclues=') != -1) {
//addthis(xextras[ixextras].split('~')[eval(-1 + xextras[ixextras].split('~').length)]);

if (tstr.indexOf(xextras[ixextras].split('~')[eval(-1 + xextras[ixextras].split('~').length)].replace('|',';')) == -1) {
//document.title+=' .+. ' + "theone = " + xextras[ixextras].split('~')[eval(-1 + xextras[ixextras].split('~').length)].replace('|',';');
sentencephrase.push(xextras[ixextras].split('~')[eval(-1 + xextras[ixextras].split('~').length)].replace('|',';'));
nsentencephrase = sentencephrase.length;
k++;
easnames.push(xextras[ixextras].split('~')[eval(-1 + xextras[ixextras].split('~').length)].replace('|',';'));
tstr = tstr.replace('</select>','<option value="' + xextras[ixextras].split('~')[eval(-1 + xextras[ixextras].split('~').length)].replace('|',';') + '">' + xextras[ixextras].split('~')[eval(-1 + xextras[ixextras].split('~').length)].split('|')[0] + '</option></select>');
//alert(tstr.split('<select ')[1]);
}


}
}
}
}

numwords = k;
//document.title=k;

tstr = tstr + "</tr></tbody></table>";
//alert(tstr);
if (done) { // || document.URL.indexOf("file:") == 0) {
done=true;
document.getElementById('mydiv').innerHTML=tstr;
} else {
done=true;
document.write(tstr);
//alert(tstr.split('<select ')[1]);
}

if (xextras.length >= 1) {
//alert(65);
if (xextras[0] != "") {
//alert(which);

if (which < 0) {
oisvalue=easnames[0].replace('|',';');
document.getElementById("s_sentencephrase").value=oisvalue;
//alert(oisvalue);
} else if (which < easnames.length) {
oisvalue=easnames[which].replace('|',';');
document.getElementById("s_sentencephrase").value=oisvalue;
//alert(oisvalue);
}
}
}

//isok=true;
//alert("numwords=" + numwords);

//for (j=0; j<numwords; j++) {
// ois = document.getElementById("s_sentencephrase");
// ois.value = easnames[Math.floor(Math.random() * numwords) + 0];
//}
setTimeout(delayit,600);
}

function delayit() {
var j, jj, ois, hdone=false, iarr;
ois = document.getElementById("s_sentencephrase");
ois.value='';
//document.title=' !!!';
iarr=ois.innerHTML.split('">');
while (ois.value == '') {
//for (j=0; j<numwords; j++) {
for (j=0; j<easnames.length; j++) {
if (easnames[j] == "") {
if (iarr.length > j) {
easnames[j]=iarr[j].split(' value="')[eval(-1 + iarr[j].split(' value="').length)];
//alert(easnames[j]);
}
}
if (!hdone) {
if (which >= 0 && which < easnames.length) {
//alert("easnames=" + easnames[which]);
//if (easnames[which] != "") {
oisvalue = easnames[which].replace('|',';');
ois.value = oisvalue;
//document.title+='-' + numwords + ' ' + easnames.length + ' ' + which + ' ' + ois.value;
hdone=true;
//}
which=-1;
} else {
jj=Math.floor(Math.random() * easnames.length) + 0;
//if (easnames[jj].replace('|',';') != "") {
oisvalue = easnames[jj].replace('|',';');
ois.value=oisvalue;
//document.title+=numwords + ' ' + easnames.length + ' ' + jj + ' ' + ois.value + ' ' + ois.innerHTML;
hdone=true;
//}
//alert(ois.value);
}
}
}
}
setTimeout(nextdelayit,900);
}

function nextdelayit() {
var ois;
ois = document.getElementById("s_sentencephrase");
ois.value=oisvalue;
//document.title+=' ,,, ' + ois.value + ' ???';
ois.click();
}

function begin() {
writeItOut();
}


function nofile(durl) {
var outd=durl;
if (durl.indexOf("file://") == 0) {
outd="http://www.rjmprogramming.com.au/HTMLCSS/words_at_work.htm";
}
return outd;
}

function shareviaemail(andsend) {
var prefix=document.getElementById('aemail').href.split('body='), suffix="";
if (extras == "") {
document.getElementById('prevscore').value=(" versus " + document.getElementById('score').innerHTML.split(" versus ")[0].replace(' over ',' from '));
document.getElementById('prevlist').value=thislist;
suffix="?wawclues=&prevscore=" + encodeURIComponent(document.getElementById('score').innerHTML.split(" versus ")[0]) + "&prevlist=" + encodeURIComponent(thislist);
if (!andsend || (prefix[0] + 'body=' + encodeURIComponent(nofile(document.URL).split('#')[0].split('?')[0] + suffix)).length < ninehundred) {
document.getElementById('aemail').href=prefix[0] + 'body=' + encodeURIComponent(nofile(document.URL).split('#')[0].split('?')[0] + suffix);
if (andsend) {
document.getElementById('aemail').click();
} else if (document.getElementById('aemail').href.length >= ninehundred) {
document.getElementById('emailee').style.display='inline';
document.getElementById('email_ask').style.display='none';
} else {
document.getElementById('emailee').style.display='none';
document.getElementById('email_ask').style.display='inline';
}
} else if (cando) {
document.getElementById('wawclues').value=extras.replace('~!','~');
document.getElementById('myform').target='myphp'; // '_self'
document.getElementById('myform').action=nofile(document.URL).split('#')[0].split('?')[0].replace('.html','.php').replace('.htm','.php');
document.getElementById('myform').method='POST';
//if (andsend) alert(98 + ' ' + document.getElementById('emailee').value);
if (andsend) document.getElementById('mysubmit').click();
}
} else {
if (andsend) waw_setCookie(extras.replace('~!','~'));
document.getElementById('prevscore').value=(" versus " + document.getElementById('score').innerHTML.split(" versus ")[0].replace(' over ',' from '));
document.getElementById('prevlist').value=thislist;
suffix="&prevscore=" + encodeURIComponent(document.getElementById('score').innerHTML.split(" versus ")[0]) + "&prevlist=" + encodeURIComponent(thislist);
if (!andsend || (prefix[0] + 'body=' + encodeURIComponent(nofile(document.URL).split('#')[0].split('?')[0] + '?wawclues=' + encodeURIComponent(extras.replace('~!','~')) + suffix)).length < ninehundred) {
document.getElementById('aemail').href=prefix[0] + 'body=' + encodeURIComponent(nofile(document.URL).split('#')[0].split('?')[0] + '?wawclues=' + encodeURIComponent(extras.replace('~!','~')) + suffix);
if (andsend) {
document.getElementById('aemail').click();
} else if (document.getElementById('aemail').href.length >= ninehundred) {
document.getElementById('emailee').style.display='inline';
document.getElementById('email_ask').style.display='none';
} else {
document.getElementById('emailee').style.display='none';
document.getElementById('email_ask').style.display='inline';
}
} else if (cando) {
document.getElementById('wawclues').value=extras.replace('~!','~');
document.getElementById('myform').target='myphp'; // '_self'
document.getElementById('myform').action=nofile(document.URL).split('#')[0].split('?')[0].replace('.html','.php').replace('.htm','.php');
document.getElementById('myform').method='POST';
//if (andsend) alert(998 + ' ' + document.getElementById('emailee').value);
if (andsend) document.getElementById('mysubmit').click();
}
}
}

function startclock() {
seconds++;
var sbits=document.getElementById('score').innerHTML.split(' over ');
if (sbits.length == 1) {
document.getElementById('score').innerHTML+=' over ' + eval(-1 + seconds) + ' seconds';
sbits=document.getElementById('score').innerHTML.split(' over ');
}
var wassbits=sbits[1].split(' ');
document.getElementById('score').innerHTML=sbits[0] + ' over ' + seconds + sbits[1].replace(wassbits[0],'');
if (emailee.indexOf('@') != -1 && emailee != 'fill.in@email.to') {
if (extras == "") {
//alert(102);
extras=emailee;
extradelim="~";
//alert('.' + emailee);
document.getElementById('emailee').value=emailee;
document.getElementById('aemail').href='mailto:' + emailee + '?' + document.getElementById('aemail').href.split('?')[1];
waw_setCookie(extras.replace('~!','~'));
} else if (extras.indexOf(emailee) != 0) {
//alert(103);
//alert('..' + emailee);
document.getElementById('emailee').value=emailee;
document.getElementById('aemail').href='mailto:' + emailee + '?' + document.getElementById('aemail').href.split('?')[1];
var spare=emailee + "~" + extras.split('~')[eval(-1 + extras.split('~').length)];
extras=spare.replace('~!','~');
}
}
setTimeout(startclock,1000);
}

function maybewhich(maybeval) {
if (prevlist != "") {
which=eval(prevlist.split(',')[0]);
if (prevlist.indexOf("" + which + ",") == 0) {
prevlist=prevlist.replace("" + which + ",","");
} else {
prevlist=prevlist.replace("" + which,"");
}
} else if (maybeval < 0) {
which=eval(-1 + eval(sentencephrase.length));
} else {
which=maybeval;
}
thislist+=thisdelim + which;
thisdelim=',';
return which;
}

function emailask() {
var ea=prompt("Email to?", document.getElementById('emailee').value);
if (ea != null) {
if (ea.indexOf('@') != -1 && ea != 'fill.in@email.to') {
document.getElementById('emailee').value=ea;
document.getElementById('aemail').href='mailto:' + ea + '?' + document.getElementById('aemail').href.split('?')[1];
emailee=ea;
}
}
}

function preaddthis(inadd) {
ina=inadd;
setTimeout(postaddthis,1000);
}

function postaddthis() {
addthis(ina);
ina="";
}

function addthis(inadd) {
var theone=null, yourone="", pretheone,ipre,lpre=1,theones, realask=false, firsttheone='', secondtheone='';
which=-1;
while (theone == null) {
if (inadd != "") {
theone=yourone;
//alert("theone=" + theone + " inadd=" + inadd);
pretheone=inadd.split('~')[eval(-1 + inadd.split('~').length)];
document.getElementById('showlast').style.display='inline';
document.getElementById('nocookies').style.display='inline';
} else {
realask=true;
pretheone=null;
if (document.URL.indexOf("file:") != 0 && isok) pretheone=prompt(inadd + "Enter your Phrase or Sentence clue then | character then comma separated list of Applicable Word Techniques used in the Phrase or Sentence clue ... and to do more than one at a time, separate by ! ... and to clear the cookie data regarding this enter a blank string (or one or more space characters only to avoid being prompted again)", "The phrase that has everything|alliteration,antonym,assonance,compound word,colloquialism,ephemism,gerund,homonym,homophone,jargon,neologism,onomatopoeia,palindrome,personification,pun,rhyme,slang,solecism,synonym");
if (pretheone != null) {
pretheone=pretheone.replace(/~/g,'');
theone=yourone;
if (pretheone.trim() == "") {
waw_deleteCookie();
extras="";
extradelim="";
if (pretheone == "") {
pretheone=null;
if (document.URL.indexOf("file:") != 0 && isok) pretheone=prompt("Enter your Phrase or Sentence clue then | character then comma separated list of Applicable Word Techniques used in the Phrase or Sentence clue ... and to do more than one at a time, separate by ! ... and to clear the cookie data regarding this enter a blank string (or one or more space characters only to avoid being prompted again)", "The phrase that has everything|alliteration,antonym,assonance,compound word,colloquialism,ephemism,gerund,homonym,homophone,jargon,neologism,onomatopoeia,palindrome,personification,pun,rhyme,slang,solecism,synonym");
if (pretheone != null) {
pretheone=pretheone.replace(/~/g,'');
if (pretheone.trim() = "") return;
}
} else {
theone=null;
realask=false;
}
}
}
}
if (pretheone != null) {
theones=pretheone.split('!');
lpre=theones.length;
if (theone != null) {
theone=theones[0];
if (document.getElementById('s_sentencephrase').innerHTML.indexOf(theone.replace('|',';')) != -1) theone=null;
}
//document.title+=' ... ' + "theone = " + theone;
} else {
realask=false;
}
if (theone != null) {
numrowsingame=eval(-1 + theone.split('|').length);
}
for (ipre=0; ipre<lpre; ipre++) {
if (theone == null) {
which=-1;
realask=false;
theone=yourone;
} else if (theone.indexOf('|') != -1) {
if (isvalid(theone)) {
if (("!" + extras + "!").indexOf(("!" + theone + "!")) == -1) {
extras+=extradelim + theone;
extras=extras.replace('~!','~');
extradelim="!";
//alert(extras);
shareviaemail(false);
}
firsttheone=theone.split('|')[0] + '|';
secondtheone=''; //theone.split(',')[1] + ',';
//alert(firsttheone);
//alert(secondtheone);
//alert(theone.replace((firsttheone + secondtheone),'').toLowerCase());
//yourone=('new Following_Orders("' + firsttheone.replace(',','@') + secondtheone + theone.replace((firsttheone + secondtheone),'').toLowerCase().replace(/\'/g,'').replace(/\"/g,'') + '"])').replace(',','"~["').replace(/,/g,'"~"').replace(/~/g,",").replace('@','","');
//sentencephrase[iinext]=theone.replace((firsttheone + secondtheone),""); //.toLowerCase().replace(/\'/g,'').replace(/\"/g,'') + '"])').replace(',','"~["').replace(/,/g,'"~"').replace(/~/g,",").replace('@','","');
//iinext++;
yourone=theone; //.replace((firsttheone + secondtheone),""); //.toLowerCase().replace(/\'/g,'').replace(/\"/g,'') + '"])').replace(',','"~["').replace(/,/g,'"~"').replace(/~/g,",").replace('@','","');
//alert(yourone);
if (document.getElementById('s_sentencephrase').innerHTML.indexOf(yourone.replace('|',';')) == -1) {
//document.title+=' .+. ' + "theone = " + yourone;
sentencephrase.push(yourone);
nsentencephrase = sentencephrase.length;
document.getElementById('s_sentencephrase').innerHTML+='<option value="' + yourone.replace('|',';') + '">' + yourone.split('|')[0] + '</option>';
//alert(document.getElementById('s_sentencephrase').innerHTML);
}
//alert('<option value="' + yourone.replace('|',';') + '">' + yourone.split('|')[0] + '</option>');
if (eval(1 + ipre) == lpre) {
if (inadd == "" || document.URL.indexOf('wawclues=') != -1) {
realask=true;
//alert('<option value="' + yourone.replace('|',';') + '">' + yourone.split('|')[0] + '</option>');
which=maybewhich(eval(-1 + eval(sentencephrase.length)));
var ihuh=newmaybewhich(eval(-1 + eval(sentencephrase.length)));
//alert('<option value="' + yourone.replace('|',';') + '">' + yourone.split('|')[0] + '</option>');
//which=eval(-1 + eval(thedefaults.length));
}
} else {
theone=theones[eval(1 + ipre)];
}
}
} else if (theone != "") {
alert('Sorry, but "' + theone + '" does not suit the game rules because the number of data fields is wrong.');
realask=false;
theone=null;
}
}
}
if (which >= 0 && realask) {
document.getElementById('showlast').style.display='inline';
//alert('<optioN value="' + yourone.replace('|',';') + '">' + yourone.split('|')[0] + '</option>');
writeItOut(); //pickobject();
//alert('<optiOn value="' + yourone.replace('|',';') + '">' + yourone.split('|')[0] + '</option>');
}
}

function newmaybewhich(iny) {
if (extras == "") {
extras=extras.replace('~!','~');
} else if (extras.indexOf("~") == -1) {
extras+="~";
extras=extras.replace('~!','~');
}
extras+=extradelim + sentencephrase[iny];
extras=extras.replace('~!','~');
extradelim="!";
waw_setCookie(extras.replace('~!','~'));
return iny;
}

function isvalid(iop) {
return true;
}

</script>
</head>
<body onload=" document.getElementById('score').innerHTML += prevscore; shareviaemail(false); setTimeout(startclock,1000); " style="background-color: lightblue;">
<form target='_self' id='myform' style='width:100%;text-align:center;' action='#' method='GET'>
<input type='submit' style='display:none;' id='mysubmit' id='subject' value='Submit'></input>
<input type='hidden' name='wawclues' id='wawclues' value='Match Word Techniques Game'></input>
<input type='hidden' name='subject' id='subject' value='Match Word Techniques Game'></input>
<input type='hidden' name='prevscore' id='prevscore' value=''></input>
<input type='hidden' name='prevlist' id='prevlist' value=''></input>

<h1 style='width:100%;text-align:center;'>Match Word Techniques Game <a style='text-decoration:none;cursor:pointer;' onclick=" document.getElementById('a_add').click(); " title='Add your own set of data, and we will let you know if it is valid or not.'>➕</a><a id='showlast' style='display:none;text-decoration:none;cursor:pointer;' title='Pick last user supplied question and add it to cookie data for game revisits' onclick="waw_setCookie(extras.replace('~!','~')); document.getElementById('nocookies').style.display='inline'; which=eval(-1 + eval(thedefaults.length)); pickobject();">🍪</a><a id='nocookies' style='display:none;text-decoration:none;cursor:pointer;' title='Clear cookies' onclick="waw_deleteCookie(); extras=''; extradelim=''; document.getElementById('showlast').style.display='none'; this.style.display='none';"><strike style='color:red;font-size:30px;'>🍪</strike></a><a id='eemail' onclick='shareviaemail(true);' title='Share via Email a link to this game'>📧</a><a id='email_ask' style='display:inline;text-decoration:none;cursor:pointer;' onclick='emailask();' title='Email ask'>❓</a> <input onblur=" if (this.value.replace('fill.in@email.to','').indexOf('@') != -1) { emailee=this.value; } " style='display:none;' name='emailee' id='emailee' value='fill.in@email.to' title='Email to'></input></h1>
<h3 style='width:100%;text-align:center;'>RJM Programming - May, 2017</h3>
<h3 style='width:100%;text-align:center;'>Thanks to Text Types in English by Mark Anderson and Kathy Anderson (ISBN: 0-7329-4584-4), or <a id='a_add' title='Add your own set of data, and we will let you know if it is valid or not.' onclick="addthis('');">add</a> your own into the mix.</h3>
<h4 style='width:100%;text-align:center;' id='score'>Score: 0/0 over 0 seconds</h4>
</form>
<a target='_top' style='display:none;' href='mailto:fillin@email.to?subject=Match%20Word%20Techniques%20Game&body=' id='aemail'>Share via Email</a>
<div id='mydiv' style='width:100%;text-align:center;'>
<script type='text/javascript'> begin(); </script>
</div>
<div id='whatisleft' style='display:none;'></div>
<iframe name="myphp" id="myphp" style="display:none;" src='//www.rjmprogramming.com.au/HTMLCSS/words_at_work.php?c=y' onload="cando=true; document.getElementById('myform').target='myphp'; document.getElementById('myform').action='//www.rjmprogramming.com.au/HTMLCSS/words_at_work.php'; document.getElementById('myform').method='POST';" onerror="cando=false;"></iframe>
</body>
</html>