Skip to content

Instantly share code, notes, and snippets.

@sambaiz
Created February 13, 2014 19:00
Show Gist options
  • Save sambaiz/8981525 to your computer and use it in GitHub Desktop.
Save sambaiz/8981525 to your computer and use it in GitHub Desktop.
#シーザー暗号
#ruby caesar.rb piyopiyo -2
#ngwmngwm
def caesar_cipher(str, shift)
str.split(//).each {|c| print (c.ord + shift.to_i).chr}
end
caesar_cipher(ARGV[0], ARGV[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment