honeylick
jupiter bound
- Joined
- Dec 5, 2002
- Posts
- 20,314
ProofreadManx said:_____
Pssst, honeylick ... they use REAL celebrities.
star fucker!

Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
ProofreadManx said:_____
Pssst, honeylick ... they use REAL celebrities.

dont worry... it wont hurt too bad...Harbinger said:Oh shit. I just realized I won some kind of geek award. And said it was cool. I'm so embarrassed. You tricked me.![]()

ProofreadManx said:Ish, hope you don't mind us hijacking this thread.
This computer shit on a Friday night just gotsta go!
Ishmael said:OK
Next problem.
YOu are going to write a little program to deliver three numbers between 1 and 50 inclusive. There can be no duplication.
The purpose is to generate, randomly, based on a 'lucky' number that the user provides six number that can be used to play the lottery.
So give me a brief description of your approach.
No matter what language you want ot work in, there is a randome numer generator available to you. This generator requires a 'seed' number, and if you use the same 'seed', you will always get the same sequence of random numbers.
Have fun.![]()
Ishmael
_____Harbinger said:Watch out, Schleicher! It seems the prize is some kind of ass fucking. You should leave the thread will you still can.
Schleicher said:Not nearly as coherent as the calendar problem. Am I generating the string of six numbers or is the user inputting those six numbers?
/* assume function that returns int and takes seed, like rand(seed) */
int try_once ( int seed, int MAX){
return rand(seed) % MAX + 1;
}
void do_everything_else(){
int seed = 0;
const int BALLS = 6;
const int MAX = 50;
int used[BALLS];
int maybe = 0;
for ( int i = 0; i < BALLS; i++) {
cout << "\nEnter your request for ball" << i+1 << ": "
cin >> seed;
boolean new_num_good = true;
do {
maybe = try_once(seed, MAX);
for (int j = 0; j < i; j++){
if ( maybe == used[j] ){
new_num_good = false;
seed = (seed +17) % MAX + 1;}}}(!new_num_good)
used = maybe;}
cout << "Your winners are: "
for ( int k = 0; k < BALLS; k++ )
cout << used[k] << " ";
}
Ishmael said:...Next prob in the AM...
Ishmael
honeylick said:now who is the 'quivering mass of satiated flesh'?
-batting lashes-
Ishmael said:I'm left anticipating nothing.![]()
![]()
Ishmael
Ishmael said:There ya go schlei. I'm going to give it to you for the effort.
I would suggest one thing. All random number gens. will come up with the same sequence given the same seed. Most folks will tend to pick the same 'lucky' numbers. So, to prevent repetitive sequences you might try seeding the generator with the miilisecond number from the system clock for the first seed.![]()
Ishmael

takingchances42 said:Using the millisecond number as the seed is not enough. Let's say that you are doing a Monte Carlo simulation, that requires you to run 10,000 "random" paths. Using just the millisecond number effectively reduces you to only ten paths.
For a better random number generator, you would pull out multiple numbers for your formula for the generation, which interact in a nonlinear fashion, so that each time the iteration was run, there would be a unique combination.
Such as seed number Z = milliseconds;
Raised to X (hundredths of a second);
Dived by Y (thousands of a second);
Raised to 1/D (date number including days, months years and seconds).
Thereby giving you a truly unique starting point and calculation formula for each possible path.
SINthysist said:
A psudo-random number is closer to truth than a random number...
')