vendor/gems/rubyzip-0.9.1/lib/quiz1/t/solutions/Thomas Leitner/solitaire.rb
# Decodes the given +msg+ using the internal deck
Decodes the given +msg+ using the internal deck
Decodes the given + msg + using the internal deck
def decode( msg )
    msgNumbers = to_numbers( msg )
    cipherNumbers = to_numbers( generate_keystream( msg.length ) )
    resultNumbers = []
    msgNumbers.each_with_index do |item, index|
      item += 26 if item <= cipherNumbers[index]
      temp = item - cipherNumbers[index]
      resultNumbers << temp
    end
    return to_chars( resultNumbers )
  end
def decode ( msg ) msgNumbers = to_numbers ( msg ) cipherNumbers = to_numbers ( generate_keystream ( msg . length ) ) resultNumbers = [ ] msgNumbers . each_with_index do | item , index | item += 26 if item <= cipherNumbers [ index ] temp = item - cipherNumbers [ index ] resultNumbers << temp end return to_chars ( resultNumbers ) end
Decodes the given +msg+ using the internal deck
Decodes the given + msg + using the internal deck
msg
<not_specific>