From: Lloyd Linklater Date: 2007-08-11T03:04:23+09:00 Subject: Re: simple cipher solver, finding all possible key combinati Aric Campbell wrote: > I had thought of using the code below to get every possible combination > and, even though it contains duplicate letters in the combinations it > generates, I was going to prune those out. The problem is that it would > take a very considerable number of years before the program finishes. > Anyone know of an algorithm that I could use to generate the > possibilities in a more timely manner? Well, you could try more than just the most common letters strategy. What you really want to do is reduce the number of possibilities. There are a limited number of legitimate one and two character words. You could start with them and see if things add up elsewhere with those letters assigned. Check the recent Ruby puzzle for finding crosswords. http://www.rubyquiz.com/quiz132.html Interestingly enough, there were a good many groovy approaches but the one listed in this link reference a widget made by google which is made for finding words like this. It seems highly optimized and could help you out. -- Posted via http://www.ruby-forum.com/.