•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 391,916 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,721 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 431 | Replies: 3
![]() |
•
•
Join Date: Jul 2008
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
<html>
<head>
<title> Sudoku game </title>
<script type="text/javascript">
a4 = Math.floor(Math.random()*5);
while (a4==0)
{
a4 = Math.floor(Math.random()*5);
}
c2 = Math.floor(Math.random()*5);
while (c2==0)
{
c2 = Math.floor(Math.random()*5);
}
</script>
</head>
<body>
<center>
<h1> Sudoku game </h1>
<form name="counter"><input type="text" size="8"
name="d2"></form>
<script>
var msec=0
var sec=90
function display()
{
if (msec<=0)
{
msec=9
sec-=1
}
if (sec<=-1)
{
msec=0
sec+=1
}
else
msec-=1
document.counter.d2.value=sec+ "." +msec
setTimeout("display()",90)
}
display()
</script>
<form>
<table>
<tr>
<td><input type="text" id="a1" size="3" /></td>
<td><input type="text" id="a2" size="3" /></td>
<td><input type="text" id="a3" size="3" /></td>
<td><input type="text" id="a4" size="3" /></td>
</tr>
</td>
<tr>
<td><input type="text" id="b1" size="3" /></td>
<td><input type="text" id="b2" size="3" /></td>
<td><input type="text" id="b3" size="3" /></td>
<td><input type="text" id="b4" size="3" /></td>
</tr>
<tr>
<td><input type="text" id="c1" size="3" /></td>
<td><input type="text" id="c2" size="3" /></td>
<td><input type="text" id="c3" size="3" /></td>
<td><input type="text" id="c4" size="3" /></td>
</tr>
<tr>
<td><input type="text" id="d1" size="3" /></td>
<td><input type="text" id="d2" size="3" /></td>
<td><input type="text" id="d3" size="3" /></td>
<td><input type="text" id="d4" size="3" /></td>
</tr>
</table>
<br/><br/>
<input type="button" value="Submit" onClick="submit();"/>
<input type="button" value="Refresh" onclick="reset()" />
</form>
</center>
<script type="text/javascript">
document.getElementById("a4").value=a4;
document.getElementById("a4").disabled="disabled";
window.status=a4;
document.getElementById("c2").value=c2;
document.getElementById("c2").disabled="disabled";
window.status=c2;
</script>
</body>
</html> Last edited by Tekmaven : 28 Days Ago at 2:19 am. Reason: Code tags
•
•
Join Date: Jul 2008
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
i think i'll random 2numbers.
Problems Im currently facing:
1) How to set counter that mark 1st , 2nd , 3rd & 4th row that form
1+2+3+4 , 2+3+4+1 , 3+4+1+2,....... total sum up to "10"
2) Prompt when the timer end.
3) Reset button what will restart the game. Once reset , my 2 random number will disappear by itself.
Thanks you people out there.
Problems Im currently facing:
1) How to set counter that mark 1st , 2nd , 3rd & 4th row that form
1+2+3+4 , 2+3+4+1 , 3+4+1+2,....... total sum up to "10"
2) Prompt when the timer end.
3) Reset button what will restart the game. Once reset , my 2 random number will disappear by itself.
Thanks you people out there.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
- Previous Thread: Image close button on hover
- Next Thread: A file named 'RESUME.XLW' already exists in this location.


Linear Mode