22.05.2011, 17:33
Hi all. I just was playing around with some code and numbers.. and i came up with this. I believe this to be %99.999 truely random. I have NEVER seen it return the same number. I'm NOT even lying! If you dont believe me, test it. Anyway, heres the code for it:
hehe. Lemme no wut i think! THX!
pawn Код:
stock rand()
{
new num=0;
new t, t2, t3;
for(new ct=0; ct<50; ct++)
{
num += ct;
num = random(num * 2);
num -= 4 * 2 / 7;
num += random(num);
num += 5 * ct;
num += random(ct * 5);
for(new dx=0; dx<ct; dx++)
{
if(num < 0)
{
num += 5000;
num *= -2;
num -= random(dx + 50);
if(num > 500000)
{
num -= 10000;
}
}
else if(num > 5000)
{
num += random(5000);
}
gettime(t, t3, t2);
t += t3 - t2;
num += t * 2 - 50;
}
if(num > 500000)
{
num -= 350000;
}
new g, g1, g2;
getdate(g, g1, g2);
g -= g1 + g2;
num += g * 2 - 8 + 6;
}
return num;
}