摘要:
/**** * 利用现有的 1--5的随机函数,加工出1 -7的随机函数 * 此函数只能用,不能修改 * 等概率返回1~5 */ /** * 构造一个等概率的1-5 */ function oneTofive() { return Math.floor((Math.random() * 5) + 1 阅读全文
posted @ 2022-05-24 01:11
NaziriteGTC
阅读(35)
评论(2)
推荐(0)
摘要:
/** * math.random()->是等概率返回【0--1) */ // 验证 math。random是等概率 function r(math){ var count=0 for(var i=0;i<math;i++){ if(Math.random()<0.3){ count++ } } r 阅读全文
posted @ 2022-05-24 01:10
NaziriteGTC
阅读(81)
评论(0)
推荐(0)