Skip to content

Instantly share code, notes, and snippets.

@cipepser
Created December 29, 2016 07:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cipepser/89bee82fa497b427b37eef97744b58ce to your computer and use it in GitHub Desktop.
Save cipepser/89bee82fa497b427b37eef97744b58ce to your computer and use it in GitHub Desktop.
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