From: Michael Fellinger Date: 2008-07-01T00:22:35+09:00 Subject: Re: Random Generation of Characters On Sun, Jun 29, 2008 at 1:47 PM, Tj Superfly wrote: > How could you generate a list of all possible combination's of lowercase > letters (a-z) and numbers (0-9). > > Example: ztd6dnck > > Now, I know of ways I can do this, but it's definitely not the most > efficient or fastest way possible, which is why I'm reaching out to this > community. It would be extremely nice if the program would do it in some > type of order (aaaaaaaa, aaaaaaab...etc. - or something along those > lines) because then it would know when it's complete. There can NOT be > ANY repeats, and it must include all combination's. order = 'aaaaaaaa' # "aaaaaaaa" order.succ! # "aaaaaaab" order.succ! # "aaaaaaac" order.succ! # "aaaaaaad" 100_000.times{ order.succ! } # 100000 order # "aaaafryh" No need to store all previous combinations, just the last one to continue. ^ manveru > > I know, it's a lot of combination's, which is why if I am going to > tackle this task, it needs to be done right. > > I would want the list to be in an array which I could then export to a > yaml file and save for later use. > > The only way I would know how to do it is if it randomly generated them, > pushed them into an array, and checked each one it generated against the > array to see if it exists already. I would never truly know if the list > is complete, because it would always be checking itself. So, > suggestions, codes, help?!?! > > Thanks to everyone in advance, I know this is a relatively large task, > but this is a powerful community and programming language and I know it > can be done. > -- > Posted via http://www.ruby-forum.com/. > >