/******selectFrom 返回iFirstValue和iLastValue间的随机数************/
function selectFrom(iFirstValue,iLastValue){
var iChoices=iLastValue-iFirstValue+1;
return Math.floor(Math.random()*iChoices+iFirstValue);
}
var aColors=["red","green","blue","yellow","blank","purple","brown"];
var sColor=aColors[selectFrom(0,aColors.length-1)];
alert(sColor);
function selectFrom(iFirstValue,iLastValue){
var iChoices=iLastValue-iFirstValue+1;
return Math.floor(Math.random()*iChoices+iFirstValue);
}
var aColors=["red","green","blue","yellow","blank","purple","brown"];
var sColor=aColors[selectFrom(0,aColors.length-1)];
alert(sColor);