Created
December 1, 2016 21:23
-
-
Save eltonsantos/b543875500091d0f851c1af162826dbb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
secret = {''=>'', "A"=>"N","B"=>"O","C"=>"P","D"=>"Q","E"=>"R","F"=>"S", "G"=>"T","H"=>"U","I"=>"V","J"=>"W","K"=>"X","L"=>"Y","M"=>"Z", "N"=>"A","O"=>"B","P"=>"C","Q"=>"D","R"=>"E","S"=>"F","T"=>"G", "U"=>"H","V"=>"I","W"=>"J","X"=>"K","Y"=>"L","Z"=>"M", "a"=>"n","b"=>"o","c"=>"p","d"=>"q","e"=>"r","f"=>"s", "g"=>"t","h"=>"u","i"=>"v","j"=>"w","k"=>"x","l"=>"y","m"=>"z", "n"=>"a","o"=>"b","p"=>"c","q"=>"d","r"=>"e","s"=>"f","t"=>"g", "u"=>"h","v"=>"i","w"=>"j","x"=>"k","y"=>"l","z"=>"m", "?"=>"?"} | |
frase = "Por que a galinha atravessou a estrada?" | |
traducao = String.new | |
frase.each_char { |char| char == " " ? traducao << "" : traducao << secret[char] } | |
puts frase | |
puts traducao |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
RESULTADO
Por que a galinha atravessou a estrada?
Cbedhrntnyvaunngenirffbhnrfgenqn?