topical media & game development
game-javascript-casual-pick-three-numbers-game.htm / htm
<!-- TWO STEPS TO INSTALL PICK THREE NUMBERS:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Original: Edward Denison (cadeye@earthlink.net) -->
<!-- Web Site: http://www.lottobets.com -->
<style>
<!--
INPUT { color:#000000 ; background-color:#80FF00; font-size:14pt }
-->
</style>
<script language="JavaScript">
function begin() {
i=0;
document.form.col1.value="V";
document.form.col2.value="V";
document.form.col3.value="V";
roll(speed);
}
function roll(speedB) {
if (document.form.col1.value=="V") {
document.form.a1.value=Math.floor(Math.random()*9) +0 ;
}
if (document.form.col2.value=="V") {
document.form.a2.value=Math.floor(Math.random()*9)+0 ;
}
if (document.form.col3.value=="V") {
document.form.a3.value=Math.floor(Math.random()*9)+0 ;
}
timerid=setTimeout("roll("+speedB+")",speedB);
}
function stop(col) {
if ( col==1) if(document.form.col1.value!=" "){
document.form.col1.value=" ";i++;}
if ( col== 2) if(document.form.col2.value!=" "){
document.form.col2.value=" ";i++;}
if ( col==3) if(document.form.col3.value!=" "){
document.form.col3.value=" ";i++;}
// speedB=500000;roll(speedB);
}
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Original: Edward Denison (cadeye@earthlink.net) -->
<!-- Web Site: http://www.lottobets.com -->
<script language="JavaScript"><!--
var speed=250,i=0,timerid;
-->
</script>
<p align="center">Press the start button, then click on <br>
the V to get your 3 digit number</p>
<div align="center"><center>
<table border="0" width="290" background="pick6.gif" bgcolor="#C0C0C0" height="300">
<tr>
<td width="315" height="241" valign="middle"> <form name="form" align="center">
<div align="center"><center><table cellSpacing="0" cellPadding="0" border="0">
<TBODY>
<tr>
<td><div align="center"><center><p><input onfocus="this.blur()" size="2" value=" "
name="a1"> </td>
<td align="center"><div align="center"><center><p><input onfocus="this.blur()" size="2"
value=" " name="a2"> </td>
<td align="center"><div align="center"><center><p><input onfocus="this.blur()" size="2"
value=" " name="a3"> </td>
<td align="center"><div align="center"><center><p><input
style="color: rgb(0,0,0); background-color: rgb(255,0,0)" onclick="begin()" type="button"
value="Start!" name="BUTTON"> </td>
</tr>
<tr align="center">
<td><div align="center"><center><p><input onclick="stop(1)" type="button" value="V"
name="col1"> </td>
<td align="center"><div align="center"><center><p><input onclick="stop(2)" type="button"
value="V" name="col2"> </td>
<td align="center"><div align="center"><center><p><input onclick="stop(3)" type="button"
value="V" name="col3"> </td>
<td vAlign="top" align="center"></td>
</tr>
</TBODY>
</table>
</center></div>
</form>
</td>
</tr>
</table>
</center></div>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<!-- Script Size: 4.08 KB -->
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.