//方法一:
function rd(n,m){
var c = m-n+1;
return Math.floor(Math.random() * c + n);
}
//方法二: function selectfrom (lowValue,highValue){ var choice=highValue-lowValue+1; return Math.floor(Math.random()*choice+lowValue); }
//方法三:
function randomNum(num1,num2){
return Math.random()*(num2-num1)+num1
}
|