<head><title>Rock, Paper, Scisors</title>
<script language="JavaScript">
<!-- Hide
/*
Rock,Paper,Siscors Script Written by freabeer@webtv.net ŽJuly 11, 1998 members.tripod.com/~grizzlyA/index.html Permission to use if comments left intact. */
var pselect = new Array;
pselect[1]="Rock";
pselect[2]="Paper";
pselect[3]="Scisors";
var total = 1;
var compick = 1;
var win = 0;
var lose = 0;
var tie = 0;
var result = "";
var view_pick="";
var view_score="";
function Win(name){ if (name == "Rock"){ total = 1;} if (name == "Paper"){ total = 2;} if (name == "Scisors"){ total = 3;} compick=(Math.random(1)); compick=compick*3; compick=Math.round(compick); if( compick >3){compick--;} if( compick <1){compick++;} if( compick == total ) { result="Tie"; tie++;} if(( compick == 1 ) && ( total == 2 )){ result="You Win";win++;} if(( compick == 1 ) && ( total == 3 )){ result="You Lose";lose++;} if(( compick == 2 ) && ( total == 1 )){ result="You Lose";lose++;} if(( compick == 2 ) && ( total == 3 )){ result="You Win";win++;} if(( compick == 3 ) && ( total == 1 )){ result="You Win";win++;} if(( compick == 3 ) && ( total == 2 )){ result="You Lose";lose++;} view_pick=("Computer picks "+pselect[compick]+"\nYou picked "+pselect[total]+"\n"+result); view_score=("Wins "+win+"\nLosses "+lose+"\nties "+tie) window.document.the_form.the_box.value=view_pick; window.document.the_form.the_score.value=view_score; }
// End Hide -->
</script>
<body bgcolor="#FFFFFF" text="#000000" link="#0000CC" vlink="#000066">
<center>
<form name=the_form>
<textarea name=the_box rows=4 cols=25></textarea> <br>
<input type="button" value="Rock" onClick=Win(this.value)>
<input type="button" value="Paper" onClick=Win(this.value)>
<input type="button" value="Scisors" onClick=Win(this.value)><br>
<textarea name=the_score rows=3 cols=15></textarea>
</form>
</center>