Created
September 23, 2015 10:06
-
-
Save iboss-ptk/fd0750c66315a72b84e3 to your computer and use it in GitHub Desktop.
Single line Caesar cipher decryption in Scala
This file contains 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
println(scala.io.Source.fromFile("assgn.txt").toList.map( x => if( "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toList contains x ) (("ABCDEFGHIJKLMNOPQRSTUVWXYZ".toList zip "GHIDDKLMNOFPMRSCTEUVBWXYYA".toList)(scala.collection.breakOut): Map[Char, Char])(x) else x ).mkString) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment