QB / QB64 Discussion Forum      Other Subforums, Links and Downloads
 

 Return to Index  

Re: Code will work fine within a relatively small range.

July 7 2012 at 9:48 AM
Moneo  (Login emoneo)


Response to Code will work fine within a relatively small range.

 

The code will run ONLY as many times as the value of MaxElements. Since if chose 325 as MaxElements, it will only run 325 times, bypassing all the duplicate random values within the range of 1 to 325. Bypassing all the duplicates was what this challenge was all about.

Yes, if MAxElements were a large number, the code would run that many times, but not hindered by the duplicate checking logic. I think you assumed that the code would continue to run until it found all the unique values, which could take a long time.

In my original code, I threw in the Unique stuff just for drill, although it is not really part of the original challenge.

Regards..... Noneo

 
 Respond to this message   
 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement