From: Aldric Giacomoni Date: 2010-01-09T02:08:03+09:00 Subject: Re: can you explain code Aashish Kiran wrote: > > ---------------------ruby code-------------------- > > after running ruby code > > in below output at first occurrence of > > "sssssssssssssssssssssss" > > can anyone explain how "nearValues" is updating > (skip long useless code and output) Well, your code says this: nearValues.size.times do |i| n = nearValues[i] next if $hash2[n].include?(pivot) nearValues[i] = nil That means, er. .. If the pivot is in $hash2[n], whatever that means, then go to the next number. Otherwise, if the pivot is not in $hash2[n], nearValues[i] is set to nil. This, incidentally, is absolutely terrible Ruby, and I want to inflict a lot of pain to the person who wrote it. -- Posted via http://www.ruby-forum.com/.