Sorry you're right, here it is:
idA = RndGen(LidA, W);
idB = RndGen(LidB, W);
Sh = RndGen(LSh, W);
private ulong[] RndGen(int NumCifre, int Base)
{
ulong[] Risultato = new ulong[NumCifre];
Thread.Sleep(15); //The generated arrays only differ if i
put this instruction, because the clock change its value, but in this
way i loose time to generate more arrays in few time (for statistic use)
Random rnd = new Random(unchecked((int)DateTime.Now.Ticks));
for (int k = 0; k < NumCifre; k++)
{
if (k == 0 && Risultato[k] == 0)
Risultato[k] = (ulong)rnd.Next(1, (Base - 1)); /
else
Risultato[k] = (ulong)rnd.Next(Base - 1);
}
return Risultato;
}
Thank you. Aspidus.
Göran Andersson ha scritto:
Aspidus said:
Hi,
I wrote a function that generates a ulong[]
I use it 3 times, one after the other, but it generates always the
same numbers.
At the end i get always 3 equal arrays.
Any idea?
Aspidus
A few ideas, but it would be far better if you showed your code so that
I could give you a definitive answer instead of vague theories about it.