S Stichler Active Member Licensed User Aug 16, 2018 #1 Hi, I'm using the following code to reseed the rndseed each time a button is clicked and random numbers are generated. Will this be effective in helping to keep duplicates from occuring? Code: RndSeed(Rnd(1, 999999))
Hi, I'm using the following code to reseed the rndseed each time a button is clicked and random numbers are generated. Will this be effective in helping to keep duplicates from occuring? Code: RndSeed(Rnd(1, 999999))
LucaMs Expert Licensed User Longtime User Aug 16, 2018 #2 You don't need that code. RndSeed is used to generate each time the same sequence of numbers and therefore just to debug your project. Upvote 0
You don't need that code. RndSeed is used to generate each time the same sequence of numbers and therefore just to debug your project.
S Stichler Active Member Licensed User Aug 16, 2018 #3 I had noticed lots of repeats, and i can not figure out how to use RandomSecure Upvote 0
LucaMs Expert Licensed User Longtime User Aug 16, 2018 #4 Stichler said: I had noticed lots of repeats Click to expand... This is because you set RndSeed; it is to be used ONLY to debug, exactly to get the same repetitions each time you run your app. This way you can check / debug your project. In your project you need (must) to use only Rnd. Upvote 0
Stichler said: I had noticed lots of repeats Click to expand... This is because you set RndSeed; it is to be used ONLY to debug, exactly to get the same repetitions each time you run your app. This way you can check / debug your project. In your project you need (must) to use only Rnd.
S Stichler Active Member Licensed User Aug 16, 2018 #5 Im sorry i should clarify I noticed lots of repeats using just Rnd once I incorporated the code it seems to be far less so Upvote 0
Im sorry i should clarify I noticed lots of repeats using just Rnd once I incorporated the code it seems to be far less so
LucaMs Expert Licensed User Longtime User Aug 16, 2018 #6 Stichler said: Im sorry i should clarify I noticed lots of repeats using just Rnd once I incorporated the code it seems to be far less so Click to expand... Without setting RndSeed? Anyway your code should work and can be used. Upvote 0
Stichler said: Im sorry i should clarify I noticed lots of repeats using just Rnd once I incorporated the code it seems to be far less so Click to expand... Without setting RndSeed? Anyway your code should work and can be used.
S Stichler Active Member Licensed User Aug 16, 2018 #7 Yes without using rndseed. It could be because it was a close set of integers but i figured better safe than sorry Upvote 0
Yes without using rndseed. It could be because it was a close set of integers but i figured better safe than sorry
LucaMs Expert Licensed User Longtime User Aug 16, 2018 #8 Stichler said: It could be because it was a close set of integers Click to expand... No. Usually the rnd function, in (all) most languages, is based on the system clock. Upvote 0
Stichler said: It could be because it was a close set of integers Click to expand... No. Usually the rnd function, in (all) most languages, is based on the system clock.
S Stichler Active Member Licensed User Aug 16, 2018 #9 Hmm dunno maybe how fast they were being generated? Either way the code I put in seems to solve the problem Upvote 0
Hmm dunno maybe how fast they were being generated? Either way the code I put in seems to solve the problem
LucaMs Expert Licensed User Longtime User Aug 16, 2018 #10 Stichler said: Hmm dunno maybe how fast they were being generated? Either way the code I put in seems to solve the problem Click to expand... Good Upvote 0
Stichler said: Hmm dunno maybe how fast they were being generated? Either way the code I put in seems to solve the problem Click to expand... Good