不使用Math.random实现随机数。
var rand = (function(){ var today = new Date(); var seed = today.getTime(); function rnd(){ seed = ( seed * 9301 + 49297 ) % 233280; return seed / ( 233280.0 ); }; return function rand(number){ return Math.ceil(rnd(seed) * number); }; })(); console.log(rand(100)) console.log(rand(100)) console.log(rand(100)) console.log(rand(100)) console.log(rand(100)) console.log(rand(100)) console.log(rand(100)) //原理参看这里 http://www.zhihu.com/question/22818104
机器瞎学/数据掩埋/模式混淆/人工智障/深度遗忘/神经掉线/计算机幻觉/专注单身二十五年