<html><head>

<title>Javascript snobby hangman game</title><script language=javascript>

var words =new Array('academician','accelerometer','addendum','adieu','adjudicate','aerial','aesthetic','affidavit','affirmation','aficionado','against','agglomerate','agrarian','agrimony','ailanthus','aileron','aisle','albacore','aldrin','aleph','algebraic','aliphatic','alkaloid','allele','alliterate','allotropic','almagest','alteration','althea','alundum','alveolus','amanuensis','amaranth','ameliorate','amity','amok','amperage','amygdaloid','ana','anastigmatic','anchoritism','andesine','angiosperm','animadversion','annulus','annunciate','anorthosite','anthracnose','antipodean','aphasia','apothecary','apse','arccosine','archipelago','arenaceous','arhat','armoire','arteriosclerosis','asphyxiate','assiduous','astatine','augur','auspicious','avaricious','avuncular','awn','baccarat','bacillus','bagatelle','balletomane','balustrade','barbiturate','basilisk','basophilic','bassi','baud','bayberry','beatitude','bel','belvedere','benthic','beryllium','betatron','bilharziasis','bijouterie','binaural','birefringent','boatswain','bodhisattva','bouffant','boustrophedon','bremsstrahlung','brindle','brocade','brucellosis','bulblet','burgeon','bursitis','butadiene','buteo','butyrate','cacao','cacophonist','caddis','cairn','calendrical','caliphate','calliope','cambric','camelopard','cascara','catatonia','catkin','cavalcade','cedilla','celesta','centroid','cerise','certiorari','chemisorption','chinquapin','cholinesterase','chrysanthemum','circumlocution','coagulable','cochineal','coleus','concertina','concomitant','consanguineous','contralto','corpulent','cretinous','croft','croupier','curvaceous','deconvolve','demagogue','deoxyribonucleic','desideratum','deuteron','diaphanous','dickcissel','dilogarithm','diopter','disambiguate','divestiture','dryad','duopolist','ebullient','econometric','ecclesiastic','ecumenist','edematous','efficacious','effluvium','eidetic','electrophorus','elegiac','emolument','encephalitis','ensconce','eohippus','epigrammatic','epiphyseal','epitaxial','equipoise','exacerbate','excrescent','exogamous','facultative','fasciculate','felicitous','fenugreek','ferruginous','fibrin','fiduciary','fisticuff','flagellate','flocculate','foci','formic','fossiliferous','fructify','gabardine','gam','gastronome','gauss','genii','geometrician','gerontology','glissade','glomerular','glossolalia','gneiss','gnomon','goniometer','grandiloquent','grapheme','guernsey','guillemot','haberdashery','harangue','hebephrenic','hecatomb','hellgrammite','hemosiderin','henequen','hermeneutic','herpetology','hibachi','hoi','homeomorphic','hying','iambic','ichneumon','idempotent','ileum','impresario','incipient','incubi','indefatigable','infarct','insouciant','intercalate','interregnum','ipso','isopleth','jejune','jocose','jonquil','kaolin','kappa','kestrel','ketosis','klaxon','kohlrabi','kulak','labile','lacustrine','laminar','landau','lascivious','lavabo','leitmotiv','lenticular','licentious','lobar','loblolly','lobscouse','loquacity','lucre','magna','maldistribute','malocclusion','mandamus','mantissa','mayapple','medico','megohm','menhaden','meretricious','merganser','mesenteric','methacrylate','miasma','mimesis','minuend','miscegenation','moduli','monadic','monocotyledon','morpheme','mulligatawny','muskellunge','mynah','neodymium','nepenthe','nubile','nugatory','numismatist','obduracy','obfuscatory','ocarina','occipital','oersted','olivine','omicron','onomatopoeic','opprobrium','paradigmatic','parsimonious','pasha','pastiche','paucity','peccary','pedagogic','pessimal','pfennig','phalanger','phalanx','phalarope','phlox','picofarad','piezoelectric','pinafore','pip','planoconvex','platinize','plenipotentiary','plumbago','poi','polemic','polloi','polyglot','porphyry','portmanteau','premonitory','profligacy','pyknotic','quadripartite','quod','rata','ratiocinate','recalcitrant','recherche','renunciate','resorcinol','rheology','rheum','rondo','rotogravure','rufous','saccade','samovar','sanguineous','scapula','schlieren','sciatica','scion','septuagenarian','servomechanism','shiv','shoji','sibilant','silane','sinusoidal','skullduggery','sobriety','sorb','sou','sovkhoz','spherule','squamous','steradian','tachinid','talus','tamarack','tecum','teratogenic','terpsichorean','thiouracil','thrum','toccata','transom','triac','troika','tropopause','vacuolate','variac','verisimilitude','vitriolic','yarmulke','yeomanry');

temp=null;

if (document.location.search.length)

temp=window.prompt("Player One enter a word."+newline()+"Player Two- don't look!",'');

word=(temp==null)?words[parseInt(Math.random()*words.length)]:temp;

hang=1;

function newline()

{

return (navigator.appName.substring(0,9)=="Microsoft")?'\r':'\n';

}

function hangman(letter) {

nohang=0;

if (document.forms[2].elements[0].value.indexOf(letter)==-1) {

window.status="";

for (i=0;i<word.length;i++) {

if (word.charAt(i)==letter) {

nohang=1;

document.forms[0].elements[i].value=letter;

}

}

if (!nohang) {

if (document.forms[2].elements[1].options[document.forms[2].elements[1].selectedIndex].value=="Easy")

hang++;

else if (document.forms[2].elements[1].options[document.forms[2].elements[1].selectedIndex].value=="Medium")

hang+=2;

else if (document.forms[2].elements[1].options[document.forms[2].elements[1].selectedIndex].value=="Hard")

hang+=3;

hang=(hang>10)?10:hang;

document.images[0].src="hang"+hang+'.gif';

if (hang>=10) {

document.location=(window.confirm("You Lose! The word was "+word+". Would you like to know what "+word+" means?"))?"http://www.m-w.com/cgi-bin/dictionary?book=Dictionary&va="+word:document.location;

}

}

else if (nohang) {

win=1;

for (i=0;i<word.length;i++) {

if (document.forms[0].elements[i].value!=word.charAt(i))

win=0;

}

if (win) {

document.location=(window.confirm("You won! Would you like to know what "+word+" means?"))?"http://www.m-w.com/cgi-bin/dictionary?book=Dictionary&va="+word:document.location;

 

}

}

document.forms[2].elements[0].value+=letter;

}

else

window.status="You already tried the letter "+letter+". Please pick again";

}

</script>

</head>

<body bgcolor="#ffffff">

<center><h2>Snobby Hangman</h2></center><br>

<script language="javascript">

document.writeln("<center><img src=hang1.gif>");

document.writeln("<form action='javascript:'>");

for (i=0;i<word.length;i++)

document.writeln("<input type=text size=1 value=' ' >");

document.writeln("</form><br>");

for (i=0;i<word.length;i++)

document.forms[0].elements[i].value=' ';

document.writeln('<form method="javascript:">');

alphabet= "abcdefghijklmnopqrstuvwxyz";

for (i=0;i<13;i++)

document.writeln("<input type=button value="+alphabet.charAt(i)+" onclick='hangman(\""+alphabet.charAt(i)+"\")'>");

document.writeln("<br>");

for (i=13;i<26;i++)

document.writeln("<input type=button value="+alphabet.charAt(i)+" onclick='hangman(\""+alphabet.charAt(i)+"\")'>");

</script>

</form><br>

Used Letters<form action='javascript:'><input type=text size=26 value=''><br>Difficulty:<p><select>

<option value="Easy" selected>Easy

<option value="Medium" >Medium

<option value="Hard">Hard

</select><br></form>

<script language="javascript">

document.forms[2].elements[0].value='';

document.writeln("<br>");

document.writeln((document.location.search==0)?'<a href="hang.htm?2">Play a two player game</a>':'<a href="hang.htm">Play a one player game</a>');

</script>

</center>

<p>&nbsp;<br>&nbsp;<br></p><p>&nbsp;<br>&nbsp;<br></p><p>&nbsp;<br>&nbsp;<br></p><p>&nbsp;<br>&nbsp;<br></p><p>&nbsp;<br>&nbsp;<br></p>

</body>

</html>