<html>
<head>
<title>HTML</title>
</head>
<body>
<script>
var balls = new Array(10);
var i=0,j=0,k=0;
for(i=0;i<10;i++)
{
balls[i]=i+1;
}
for(i=1;i<=1000;i++)
{
j=Math.floor(Math.random()*9);
k=Math.floor(Math.random()*9);
balls[9]=balls[j];
balls[j]=balls[k];
balls[k]=balls[9];
}
document.write(balls[0]+","+balls[1]+","+balls[2]+",");
</script>
</body>
</html>
沒有留言:
張貼留言