From: Giampiero Zanchi Date: 2010-02-16T18:03:35+09:00 Subject: Re: Generating all possible combinations of a 5 digit pattern. one more solution p (0..(2**5-1)).map{|n| (n.to_s 2).tr("01", "CN").rjust(5,"C") } -- Posted via http://www.ruby-forum.com/.