Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.
Problem w/ Random num gen in Pascal
Name: Comp01 Date: May 18, 2004 at 22:00:31 Pacific OS: Windows 98SE CPU/Ram: 566Mhz Celeron/64MB
Comment:
Ok, I know that the identifier for a random number is Random or Random(10) - etc, but, it keeps displaying the SAME numbers over and over, I need it to display DIFFERENT numbers, each time, (specifically a number between 0 and 6 or 0 and 7)... Is there a way to fix this?
Name: wizard-fred Date: May 19, 2004 at 00:29:42 Pacific
Reply:
You have to seed the random generator. Is there a statement like RANDOMIZE? Check your language reference. I haven't done a Pascal program in nearly 20 years.
Are you throwing a die?
0
Response Number 2
Name: geolew Date: May 19, 2004 at 07:30:02 Pacific
Reply:
Try This
The Random command will give you a random number from 0 to the number you give it - 1. The Random command generates the same random numbers every time you run a program so the Randomize command is used to make them more random by using the system clock.
Summary: I am using GCC compiler on Linux. I have a problem. ;) I have to use something like this sequence ( in Pascal ) repeat ... c := readkey; until keypressed; ..in my ANSI C program. I MUST compil...
Summary: Hello, I need to create a randome number generator for the number 1 through 52.... including 1 and 52. My teacher told me something about using GMT to create the random number, but i wasn't exactly s...
Summary: Hi, im having difficulty with the random number generator in C, rand(). What Im trying to do is estimate the mean of a real number generator. So I need the random function to throw up a real number ...