function doubleBall(){
var reds=[];
var blue=null;
//reds的个数<6
while(reds.length<6){
//在1-33之间生成1个随机整数,保存在r中
var r=parseInt(Math.random()*(33+1));
//如果reds中不包含 r
if(var reds.indexOf(reds)==-1){
//将r压入reds中
reds.push(r);
}
}
//将reds按数字升序排列,,
function compare(a,b){return a-b;}
//将reds按数字升序排列
reds.sort(compare);
document.write(String(reds));
}
doubleBall();
var reds=[];
var blue=null;
//reds的个数<6
while(reds.length<6){
//在1-33之间生成1个随机整数,保存在r中
var r=parseInt(Math.random()*(33+1));
//如果reds中不包含 r
if(var reds.indexOf(reds)==-1){
//将r压入reds中
reds.push(r);
}
}
//将reds按数字升序排列,,
function compare(a,b){return a-b;}
//将reds按数字升序排列
reds.sort(compare);
document.write(String(reds));
}
doubleBall();
616

被折叠的 条评论
为什么被折叠?



