From: Michael Linfield Date: 2007-10-20T13:39:21+09:00 Subject: Re: combinations listing I know this post is getting long so ill try to wrap things up with a last question haha, ur post above kind of inspired me to change my version to write the permutations to a file rather than memory. 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} stuff = File.new("wordhash.txt","w+") puts "Finding All Possible Combinations..." modinput.each_permutation {|word| stuff.puts word.join} store = File.open("wordhash.txt","r") res = [] store.each {|c| res << c} res.inspect puts "Finished." puts "Solutions: #{res&dict}" ############ Works fine expect the results are screwd because the output is as follows for a res.inspect [\"rdow\\n\"] #just using a brief example ... this would be 1 element for the anagram of "word"... Now theoretically i could do a res.collect! but thats getting sloppy doing that too much so is there any way to strip off the \'s? Thanks! -- Posted via http://www.ruby-forum.com/.