General > Off Topic
Rnd function
Botsareus:
Yes, The Visual Basics Rnd function after a period of time produces repeating data?
Any one know a soultion to this?
We can use the rnd function in combination with another really clever way to generate numbers. ex:
An example of a way will be to mesure the uncertainty of the processor and the system timer interacting and/or then uncertainty of the processor and the hard drive interacting
The ultimate source for random information will be the internet but who is going to bother with a system of collecting that information or with running DB only when pc is online.
PurpleYouko:
Try
"randomize timer"
before each rnd event
This will pretty much never produce a repeating sequence as the seed number is always inherantly changing.
:D PY :D
Botsareus:
ok I will , There is a limit on how mutch "time numbers" the program understands though
To make it even better we can make it
--- Quote ---Timer + Val(Replace(Date, "/", ""))
--- End quote ---
thanks for your help PY
But I already use "randomize" witch basicaly means "randomize timer" in my code
Here is an idea
--- Quote ---Private Sub Form_Load()
Randomize Timer + Val(Replace(Date, "/", ""))
MsgBox Rnd(-(Timer + Rnd))
End Sub
--- End quote ---
The confusion here is:
Lets say A is not the same number over time:
Does "Randomize A" get compiled by visual basic by converting it into
"Rnd(-abs(A))" on each rnd call? or somthing close to that?
Numsgil:
Bots, found a gaussian curve online from that online book I showed you. It's in C, but it isn't hard to convert it to VB.
I can't paste it here because of formatting issues, and the fact that the source is a PDF, and cause I'm lazy. But here is the section its in. Search for gasdev. It's at the very end.
Are we talking about the period of a random number function here?
Everyone wanting to discuss this read this introduction and this section on the basics of random number generation.
Basically, a computer can't produce random numbers. Well, not unless you attach a geiger counter to it and generate random bits based on that. The only source of truly random stuff is nature. But for most purposes the random number generators of a computer are good enough.
The above articles are written for C standard (my favorite language! :P :ph43r:), but you can probably figure out what's going on without too much trouble. Everything it talks about are just as true for VB as for and C compiler.
Botsareus:
Thanks but its just even more confusion; I have not even learned Precalcules; And AAAAAAAAA! C~!~~!~ <_<
Can some one just give me a simple ans.:
--- Quote ---The confusion here is:
Lets say A is not the same number over time:
Does "Randomize A" get compiled by visual basic by converting it into
"Rnd(-abs(A))" on each rnd call? or somthing close to that?
--- End quote ---
If you want Num give me a year by then I should learn Precal...
Freighting thoughts: Is collage going to exsept me if I dont know Precal??
---
I am reading , I am reading...
Navigation
[0] Message Index
[#] Next page
Go to full version