|
-
May 24th, 2007, 08:07 AM
#1
Thread Starter
PowerPoster
[RESOLVED] Random numbers being TOO random
I am currently writing a sudoku game and I am trying to get it so that I can input a number to seed the random number generator...from what I remembered, if you use "randomize x" the numbers returned from rnd() will always be the same for the same number x (so if you made x = 1 then the rnd() would always return, for instance, 100-49-120-105-12-etc every single time you randomized with the number 1)...am I missing something though?
I basically want to be able to seed the generator then *reset* the random sequence so I get the same sequence of numbers as last time I seeded with the same numbers...and I can't seem to remember how to do it :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
May 24th, 2007, 08:17 AM
#2
Thread Starter
PowerPoster
Re: Random numbers being TOO random
Think I have worked it out...found an old post by BushMobile which describes how to sort it...I need to use a negative number in the rnd(x) (make x negative) to restart the seed :-)
And it seems the negative number used is what affects the seed, which is weird...I'm sure it was done differently before
Last edited by smUX; May 24th, 2007 at 08:21 AM.
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|