相关问题
- Unity - Get Random Color at Spawning
- How to generate a random number, then display it o
- how to randomly loop over an array (shuffle) in ba
- How to fill an array with random numbers from 0 to
- Upper bound of random number generator
相关文章
- why 48 bit seed in util Random class?
- Need help generating discrete random numbers from
- Get random records with Doctrine
- Looking for a fast hash-function
- Oracle random row from table
- Generate a Random Number between 2 values to 2 dec
- What does Random(int seed) guarantee?
- What’s the best way to shuffle an array in Perl?
你百度下洗牌算法
Random
2L的写法不可取,如果是定长,那么创建定长的Random(每个Random不可并发,不同种子)。
上面说法是按照随机来说的。
实际情况:正常如果是赚钱的彩票,如果按照“老虎机”返水算法远远不会这么简单(老板一定不会赔本,但这个算法明显比老虎机算法简单【老虎机存在几十选多的情况,cpu无法承受】,这个算法你基本上不会搜到结果,只能自己去想)。
void Main()
{
var rnd=new Random();
var lst=new List<int>();
for (var i=0;i<100;i++){
lst.Add(rnd.Next(0,100));
}
lst.Dump();
}