📧 Message Board Archive

Seeded randomizer for Dink?
Anybody know a simple formula for pseudo random numbers that doesn't use fractions, arreys, large exponents or any of the other things Dink C doesn't have?



I know Dink C has a random funstion but I want something I can put a number into and get a random seeming number based on that.
Re: Seeded randomizer for Dink?
: Anybody know a simple formula for pseudo random numbers that doesn't use fractions, arreys, large exponents or any of the other things Dink C doesn't have?

: I know Dink C has a random funstion but I want something I can put a number into and get a random seeming number based on that.



I'm not sure what this is for, but instead of:

int &rand = random(10,1);

 you might be able to:

int &rand = random( &this,&that);

will that help?
Sorry, doesn't help. Anyone else?
: I'm not sure what this is for, but instead of:

: int &rand = random(10,1);

:  you might be able to:

: int &rand = random( &this,&that);

: will that help?



Nope. What I want is a number which is apperently random, but dependand on the number I input. I want to yo for example put in 3 and get 17, every time. Or get 5 when I put in 4, every time.



This is how all random number generaters work, but the build in one probably runs of the system clock, so it's different each time.
Re: Sorry, doesn't help. Anyone else?
How many combinations are you after?
Re: Sorry, doesn't help. Anyone else?
: How many combinations are you after?



Lots. 244140625 in one case, a smaller but indefinite number in another. So if you're thinking I could just make table... :p However the output would only be numbers less than 100.
Re: Sorry, doesn't help. Anyone else?
: : How many combinations are you after?

: Lots. 244140625 in one case, a smaller but indefinite number in another. So if you're thinking I could just make table... :p However the output would only be numbers less than 100.



So you want to be able to enter up to 240 million different values and then have each of those generate a unique repeatable new value between 1 and 100, so each number between and 100 can be returned by over 2441406 numbers? Can I ask why?

Re: Sorry, doesn't help. Anyone else?
: : : How many combinations are you after?

: : Lots. 244140625 in one case, a smaller but indefinite number in another. So if you're thinking I could just make table... :p However the output would only be numbers less than 100.

: So you want to be able to enter up to 240 million different values and then have each of those generate a unique repeatable new value between 1 and 100, so each number between and 100 can be returned by over 2441406 numbers? Can I ask why?



Both are basically random landscapes, a dimensional one and a 2-dimensional one. The contents of each location should be consistant between visits, but  it doesn't have to be anything particular. Pluging the co-ords into a randomizer seemed like a good way to do that for a large area. Of course it's no good if I can't find one.



Currently the 4-dimensional one uses some gook I threw togeather myself, but you can't actually walk between cels in that one, in the 2D one where you can, I think the formula would quickly become obvious.
Re: Sorry, doesn't help. Anyone else?
: : : : How many combinations are you after?

: : : Lots. 244140625 in one case, a smaller but indefinite number in another. So if you're thinking I could just make table... :p However the output would only be numbers less than 100.

: : So you want to be able to enter up to 240 million different values and then have each of those generate a unique repeatable new value between 1 and 100, so each number between and 100 can be returned by over 2441406 numbers? Can I ask why?

: Both are basically random landscapes, a dimensional one and a 2-dimensional one. The contents of each location should be consistant between visits, but it doesn't have to be anything particular. Pluging the co-ords into a randomizer seemed like a good way to do that for a large area. Of course it's no good if I can't find one.

: Currently the 4-dimensional one uses some gook I threw togeather myself, but you can't actually walk between cels in that one, in the 2D one where you can, I think the formula would quickly become obvious.



Why did you suddenly start talking about dimensions?