<!doctype html>
<html>
<head>
<title>Subject Areas - RJM Programming - December, 2016 ... Thanks to Five-Minute Activities by Penny Ur and Andrew Wright page 25</title>
<link href='//www.rjmprogramming.com.au/PHP/emboss_h1.css' rel='stylesheet' type='text/css'>
<script type='text/javascript'>

var subjectarr=["Astronomy;planet,comet,moon,sun,star,black hole",
"Biology;mammal,reptile,amphibian,insect,bird,fish,invertebrates,warm blooded,monotreme,flora,fauna,plant,animal",
"Carpentry;saw,hammer,screwdriver,rasp,chisel,nail,screw,fastener,plank,workbench,vice,shed",
"Drama;actor,actress,director,producer,comedy,sitcom,audience,atmosphere",
"English;vowel,verb,noun,grammar,adjective,adverb,pronoun,subject,object,consonant,conjunction,predicate",
"Fencing;epee,lunge,blade,assault,on guard",
"Gardening;weeds,raking,bark,mulch,spade,hole,watering,rockery,fertiliser",
"Horticulture;agriculture,medicinal plants,fruits,vegetables,nuts,seeds,herbs,sprouts,mushrooms,algae,flowers,seaweeds,watering",
"Indochina;Vietnam,Laos,Thailand,Malaysia,Myanmar,Mekong River,silk,rice,butterflies,lanterns,monsoon,markets,street food,rubber",
"Judo;martial arts,kick,fall,protection,discipline,Olympics,Japan",
"Kelpie;dog,mustering,droving,instinct,sheep,kennel,breed,temperament,work",
"Locomotion;Kylie Minogue,train,steam engine,carriage,track,coal,stoke,fire",
"Mathematics;algebra,calculus,trigonometry,measurement,numbers,square,square root,problem,solving,assert,proof,integration,induction,reasoning,graph,table,hypothesis",
"Numerology;mystery,belief,luck,feng shui,superstition,magic",
"Oncology;medicine,prevention,diagnosis,treatment,cancer,hospital,doctor,tumor,lymphoma,screening,risk factor",
"Paleontology;science,life,epoch,fossil,organism,evolution,environment,research",
"Quidditch;Harry Potter,sport,players,Hogwarts,seeker,broomsticks,rings,riding,tournament",
"Render;draw,building material,realize,cement,acrylic,image,image synthesis,architecture,video games,simulators,movie,visual effects",
"Silver;metal,element,periodic table,jewellery,shiny,white,copper,gold,lead,zinc,mine",
"Tennis;ball,player,doubles,singles,tournament,umpire,trophy,seeding,schedule,ace,love,deuce,winnings,sport,exertion,fitness",
"Unit;one,measure,apartment,single,flat,standard,magnitude,convention,metric,avoirdupois",
"Velocity;speed,engine,friction,angular,relative,phase,group,proper,position,frame of reference",
"Wind;pascals,hectopascals,atmospheric pressure,low,high,hurricane,tornado,storm,tempest,blow",
"X-Ray;radiation,medicine,bones,teeth,X-radiation,wavelength,electromagnetic,frequency,crystallography",
"Yoghurt;culture,milk,protein,fermentation,lactose,bacteria,lactic acid",
"Zygote;eukaryotic,cell,fertilization,gamete,embryo,genome,DNA,biology,animal,human,foetus,woman,sexual fusion,karyogamy,diploid,zygospore,meiosis,mitosis,life cycle,species"
];
var ourwordlist=[];
var ourwordassociation=[];
var rownum=0;
var alreadytriedlist=";";
var score=0, goes=0;
var mode='difficult';
var modeprefix='data-';

function scoreit(selo, versus) {
var which=selo.id.replace('selword','');
if (alreadytriedlist.indexOf(';' + selo.value + ',' + versus + ';') != -1) {
alert("You have already tried this combination, thanks.");
} else {
alreadytriedlist += selo.value + ',' + versus + ';';
goes++;
//if ((',' + selo.options[selo.selectedIndex].alt + ',').indexOf((',' + versus + ',')) != -1) {
if ((',' + selo.options[selo.selectedIndex].getAttribute(modeprefix + 'title') + ',').indexOf((',' + versus + ',')) != -1) {
score++;
if (document.getElementById('okwords' + which).innerHTML == '') {
document.getElementById('okwords' + which).innerHTML = selo.value;
} else {
document.getElementById('okwords' + which).innerHTML += ',' + selo.value;
}
} else {
alert("Sorry, we don't have " + versus + " on our list of applicable subjects for " + selo.value + ".");
}
document.getElementById('score').innerHTML = 'Score: ' + score + ' from ' + goes + ' goes';
}
}

function locy(thisvalue) {
location.href='./subject_areas.htm?score=' + score + '&goes=' + goes + '&difficulty=' + thisvalue;
}

function fillintable(phase,addthis) {
var i,j,thisrow="",thesewords,k,selinnards='';
if (phase == 0) {
mode=location.search.split('difficulty=')[1] ? location.search.split('difficulty=')[1].split('&')[0] : 'difficult';
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
phase=phase;
} else if (mode.replace('difficult','') != '') {
modeprefix='';
document.getElementById('ifnm').innerHTML='<select onchange=" locy(this.value); "><option value=easy>Hints (on hover) Game</option><option value=difficult>No Hints Game</option></select>';
} else {
document.getElementById('ifnm').innerHTML='<select onchange=" locy(this.value); "><option value=difficult>No Hints Game</option><option value=easy>Hints (on hover) Game</option></select>';
}
var addit=location.search.split('addthis=')[1] ? decodeURIComponent(location.search.split('addthis=')[1]).split('&')[0] : '';
if (addit != '') {
if (addit.replace(/[/g,'').replace(/]/g,'').indexOf('"') == 0) {
var recs=(addit + '~').replace(/[/g,'').replace(/]/g,'').replace('"','').replace('"~','').replace('~','').split('","');
for (k=0; k<recs.length; k++) {
subjectarr.push(recs[k]);
}
} else {
subjectarr.push(addit);
}
}
var newscore=location.search.split('score=')[1] ? decodeURIComponent(location.search.split('score=')[1]).split('&')[0] : '0';
var newgoes=location.search.split('goes=')[1] ? decodeURIComponent(location.search.split('goes=')[1]).split('&')[0] : '0';
if (newgoes != '0') {
document.getElementById('score').innerHTML = 'Score: ' + newscore + ' from ' + newgoes + ' goes';
score=eval(newscore);
goes=eval(newgoes);
}
for (i=0; i<subjectarr.length; i++) {
thisrow="<tr id=tr" + i + "><td id=subject" + i + ">" + subjectarr[i].split(';')[0] + "</td><td id=words" + i + "><select id=selword" + i + " onchange=scoreit(this,'" + subjectarr[i].split(';')[0] + "');><option value=>Please select a word applicable to " + subjectarr[i].split(';')[0] + "...</option></select></td><td id=okwords" + i + "></td></tr>";
thesewords=subjectarr[i].split(';')[1].split(',');
for (j=0; j<thesewords.length; j++) {
k = ourwordlist.indexOf(thesewords[j]);
if (k == -1) {
ourwordlist.push(thesewords[j]);
ourwordassociation.push(";" + subjectarr[i].split(';')[0]);
} else {
ourwordassociation[k] += ',' + subjectarr[i].split(';')[0];
}
}
document.getElementById('mytbody').innerHTML+=thisrow;
}
for (i=0; i<ourwordlist.length; i++) {
ourwordlist[i] += ourwordassociation[i];
}
ourwordlist.sort();
for (i=0; i<ourwordlist.length; i++) {
selinnards += "<option " + modeprefix + "title='" + ourwordlist[i].split(';')[1] + "' value='" + ourwordlist[i].split(';')[0] + "'>" + ourwordlist[i].split(';')[0] + "</option>";
}
for (i=0; i<subjectarr.length; i++) {
document.getElementById('selword' + i).innerHTML += selinnards;
}
fillintable(-1,'');
} else if (phase < 0) {
phase = phase;
} else {
location.href='./subject_areas.html?addthis=' + encodeURIComponent(addthis) + '&score=' + score + '&goes=' + goes;
}
}

function ask() {
var youridea=prompt('What is your own subject area (of the form)? For multiple new subject area ideas try "Baking;yeast,dough,oven,rolling","Blood Hounds;smell,floppy ears,slobber,pet" type of entry.', 'Baking;yeast,dough,oven,rolling');
if (youridea != null) {
if (youridea != '') {
fillintable(1, youridea);
}
}
}

</script>
</head>
<body onload=" fillintable(0,''); " style="background-color:aqua;">
<h1>Subject Areas <div id='ifnm' style=display:inline;></div> <a title='Your Own Subject Area' style='text-decoration:underline;cursor:pointer;' onclick='ask();'>+</a></h1>
<h3>RJM Programming - December, 2016</h3>
<h3>Thanks to Five-Minute Activities by Penny Ur and Andrew Wright page 25</h3>
<h4 id=score>Score: 0 from 0 Goes</h4>
<table cellpadding=10 cellspacing=10 border=20 id='mytable' style='background-color:yellow;'><tbody id='mytbody'><tr><th>Subject</th><th>Words to Choose From</th><th>Applicable Word List</th></tr></tbody></table>
</body>
</html>