Skip to content

Instantly share code, notes, and snippets.

@sambaiz
Created February 13, 2014 19:02
Show Gist options
  • Save sambaiz/8981568 to your computer and use it in GitHub Desktop.
Save sambaiz/8981568 to your computer and use it in GitHub Desktop.
abcdefghijklm <-> nopqrstuvwxyzで文字を置換しただけの暗号@CodeIQ
scala> val angou = "fhaal naq jvaql"
angou: String = fhaal naq jvaql
scala> angou.map({s => if(s < 'a' || s > 'z') s else if(s <= 'm') (s + 'n' - 'a').toChar else (s - 'n' + 'a').toChar})
res43: String = sunny and windy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment