From: Brian Adkins Date: 2007-10-20T16:30:03+09:00 Subject: Re: combinations listing On Oct 19, 9:25 pm, Michael Linfield wrote: > Thanks Brian, after testing out one of the 2 methods i get better > results...I was going to use your permutation method but i get a > localjumperror, I'll have to look into it more because i generally just > glanced at the define: You need to pass in a block. > def words chars, result='', &b > if chars.empty? > yield result > else > chars.length.times do |i| > c = (x = chars.clone).slice!(i) > words(x, result + c, &b) > end > end > end > > ... > Oh, one other question, if i wanted to benchmark this entire program in > 1 clean sweep how would i do it, id like to compare the before and after > methods to see if they are in fact actually making a dent. With words > such as alphabetically i still have the issue of the overhaul on ram > creating billions of permutation possibilities lol. Creating all possible permutations is the wrong approach. See my other post.