Thread
:
non-repetitive random number
View Single Post
Feb 14th, 2007, 8:54 AM
#
3
InfoGeek
Professional Programmer
Join Date: Jun 2005
Location: India, The great.
Posts: 435
Rep Power:
4
or you can do something like...
(
Toggle Plain Text
)
for(i=0;i<100;++i) a[i] = i+1; for(i=0;i<100;++i) swap(a[i], a[rand()%100]);
for(i=0;i<100;++i) a[i] = i+1; for(i=0;i<100;++i) swap(a[i], a[rand()%100]);
__________________
PFO - My daily dose of technology.
InfoGeek
View Public Profile
Find More Posts by InfoGeek