source/euler59.rb
def decode(numbers, key)
  result = ""
  numbers.each_with_index do |n, i|
    result += (n ^ key[i % 3].ord).chr
  end
  result
end
# I just discovered you could do this.
I just discovered you could do this.
I just discovered you could do this .
def decode(numbers, key)
  result = ""
  numbers.each_with_index do |n, i|
    result += (n ^ key[i % 3].ord).chr
  end
  result
end
def decode ( numbers , key ) result = "" numbers . each_with_index do | n , i | result += ( n ^ key [ i % 3 ] . ord ) . chr end result end
I just discovered you could do this.
I just discovered you could do this .
numbers
key