From: Michael Linfield Date: 2007-10-20T10:25:59+09:00 Subject: Re: combinations listing 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: 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 ################ None-the-less here is what i came up with by creating a faster matching method for larger words. require 'rubygems' require 'facets/enumerable' print "Enter Word: " input = gets.chomp modinput = input.split('') modlength = modinput.size file = open('dict1.txt') {|p| p.readlines} dict = [] file.each {|p| dict << p} file.delete_if {|x| x.size - 1 > modlength} res = [] puts "Finding All Possible Combinations..." modinput.each_permutation {|word| res << word.join} res.collect! {|c| c + "\n"} puts "Finished." puts "Solutions: #{res&dict}" ############# You'll have to explain your method a little more in-depth to me, haha, got confused a bit from that last post. Thanks a ton btw. 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. -- Posted via http://www.ruby-forum.com/.