public/subjects/rot14
lee 8ffc65ce3d chore(exam): remove all folders that contained "-exam" suffix & add the main.go to exercises that needed it 2024-01-04 09:36:37 +00:00
..
README.md Update README.md 2021-08-26 11:50:37 +01:00
main.go chore(exam): remove all folders that contained "-exam" suffix & add the main.go to exercises that needed it 2024-01-04 09:36:37 +00:00

README.md

rot14

Instructions

Write a function rot14 that returns the string within the parameter transformed into a rot14 string. Each letter will be replaced by the letter 14 spots ahead in the alphabetical order.

  • 'z' becomes 'n' and 'Z' becomes 'N'. The case of the letter stays the same.

Expected function

func Rot14(s string) string {

}

Usage

Here is a possible program to test your function :

package main

import (
	"piscine"
	"github.com/01-edu/z01"
)

func main() {
	result := piscine.Rot14("Hello! How are You?")

	for _, r := range result {
		z01.PrintRune(r)
	}
	z01.PrintRune('\n')
}

And its output :

$ go run .
Vszzc! Vck ofs Mci?
$