Created
December 29, 2016 07:55
-
-
Save cipepser/89bee82fa497b427b37eef97744b58ce to your computer and use it in GitHub Desktop.
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
package main | |
import ( | |
"fmt" | |
) | |
func cipher(r rune) string { | |
var u rune | |
if r >= []rune("a")[0] && r <= []rune("z")[0] { | |
u = 219 - r | |
} else { | |
u = r | |
} | |
return string(u) | |
} | |
func main() { | |
plain := "This is a pen." | |
for _, s := range plain { | |
fmt.Println(cipher(s)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment