sometimes when i put randomize() in a loop it doesnt work... why?
sometimes when i put randomize() in a loop it doesnt work... why?
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
What exactly is "doesn't work"?Originally posted by major_small
sometimes when i put randomize() in a loop it doesnt work... why?
First off, "randomize" is compiler specific (read: Borland).
Second, "randomize" is basicly the same thing as "srand", and as such, should only be called once per program execution.
Quzah.
Hope is the first step on the road to disappointment.
well, first you have to srand(time(NULL)) so you get a new number every time and in vc++
its #include <stdlib.h>
rand()%number;
which gives you a random number from 0-number
randomize() has a very wide range in usage so "doesn't work" won't really mean anything.
Care to share some code?