Random Numbers
-
hello. Do you have an funcion that gives back "randomized" numbers. for example: ranomize(6) should return 0, 1, 2, 3, 4 or 5. know what I mean? I hope you can help me. I need this funktion for a simulation. The objects should decide by themselves in which direction they will go. :o) life is fun! Johannes //still a newbie
-
hello. Do you have an funcion that gives back "randomized" numbers. for example: ranomize(6) should return 0, 1, 2, 3, 4 or 5. know what I mean? I hope you can help me. I need this funktion for a simulation. The objects should decide by themselves in which direction they will go. :o) life is fun! Johannes //still a newbie
-
hello. Do you have an funcion that gives back "randomized" numbers. for example: ranomize(6) should return 0, 1, 2, 3, 4 or 5. know what I mean? I hope you can help me. I need this funktion for a simulation. The objects should decide by themselves in which direction they will go. :o) life is fun! Johannes //still a newbie
-
This works for me : srand( (unsigned)time( NULL ) ); // Initialise rand with the current time to get // a truly random seed int ivariable = rand() % 5 // result between 0 and 5