quote:
Originally posted by CookieRevised
Actualy foaly's method is not going to work
It works perfectly fine for generating the random number without repetition until 10 others have been selected.
quote:
Originally posted by CookieRevised
foaly's method doesn't return anything if the randomly generated lyric already exists in the past 10 lines! His function would simply stop.
Yes it does, it's a recursive function if you look closely. If the line exists it simply calls itself again until it returns a new number.
quote:
Originally posted by CookieRevised
quote:
Although I think instead of:
count=count%9
You should replace it with:
count= (count==9 ? 0:count);
Because you don't want to have unnecessarily large integers being stored in memory.
it wouldn't make a difference.
I already said this in the edit about 8 hours ago =/
Granted, the theory behind your idea is much more intelligent and efficient you shouldn't be dissing people's suggestions without first understanding them