From: dblack@... Date: 2006-11-15T22:25:33+09:00 Subject: Re: Var types as parameters Hi -- On Wed, 15 Nov 2006, Flaab Mrlinux wrote: > Farrel Lifson wrote: >>> Posted via http://www.ruby-forum.com/. >> >> Could you show us the code which is doing this? >> >> Farrel > > Yes. Here it is... The objetive of the program is the following: > > - The user inserts a string of 15 signs. > - The program loads a .txt file with a bunch of strings of 15 signs > - The program compares each string of the file with the one the user > wrote, and returns the number of signs matching between ALL the strings > in the file with the one the user wrote, but only beggining at a minimum > amount of 10. > > Here it goes [...] > combi_file.each do |line| > combi = line > > combinacionTemp = combi.to_a #Devuelve combinacionTemp y genera un > array > cganadora.comprobacion(combinacionTemp) When you to the to_a, you're going to end up with an array of one element -- namely, the whole line. I think you want to split it up into characters. David -- David A. Black | dblack@rubypal.com Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4] [1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com [2] http://dablog.rubypal.com | [4] http://www.rubycentral.org