|
-
Jun 24th, 2010, 09:45 PM
#21
Re: Random Unique Lists of 12 Numbers
 Originally Posted by Billy Conner
From what i get, the OP wants to display a list of all sequences of 12 different numbers 1-90, but without using the same exact numbers in a different sequence. i really don't see why the sequence order would be important since there is only one available sequence per group of numbers to be used. He doesn't say the numbers are inputted, as far as i know they could be incremented in the loop. He says sequence matters but he goes on to say that you cannot have the same numbers in a different sequence, that is all he says; nothing about "i need to use the sequence in my program for some other purpose", so i cannot say for sure this isn't what he's looking to do. BUT if the number sequence turns out to be important in whatever it is that he is making, its only 6 more bytes to store instead of the 12 you suggest to hold the info needed to return the numbers to the exact order in which they were presented.(you only need 4 bits to hold 0-11 or 1-12)
anhn has the right idea when it comes to performing this task, which is you don't need to loop to check for duplicate sequences, if you can loop 90^12 times and grab the bits from it(as i do in my example) then you can find every possible non-duplicate sequence that exists in order. Some may argue that vb cannot work with numbers that large but there are ways around the number limitation to get the job done. the only thing stopping you with it is it would still take forever to loop every single sequence, and there is no place large enough for you to store the sequences anywhere.
Sorry, I don't see how it can be compressed to 6 bytes. Please explain again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|