<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script>
//线产生6个红色号码
var redBall=[];
//给数组中导入33个数字
for(var i=1;i<=33;i++){
redBall.push(i);
}
//打乱顺序
redBall.sort(function(){
//返回值大于0,则两两互换
//50%概率1和-1的出现
return Math.random()>0.5?-1:1;
});
var nBall=[];
for(var i=0;i<6;i++){
nBall.push(redBall[i])
}
nBall.sort(function(a,b){
return a>b;
});
var blueBall=Math.ceil(Math.random()*16);
document.write(nBall+":"+blueBall)

</script>
</head>
<body>

</body>
</html>

05-20 20:48