From: Max Williams Date: 2008-07-01T18:29:04+09:00 Subject: Re: how to - quickly make permutations? jim finucane wrote: > def permutations (n,max_size) > result = [[]] > for i in 1..n > result +=result.collect{|x| x.length end > return result.uniq - [[]] > end Jim, this wins the elegance prize i think! It's almost magical...i can't quite get my head round it. :) -- Posted via http://www.ruby-forum.com/.