mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
738 B
48 lines
738 B
6 years ago
|
## ROT 14
|
||
6 years ago
|
|
||
6 years ago
|
### Instructions
|
||
6 years ago
|
|
||
|
Write a function `rot14` that returns the string within the parameter but transformed into a rot14 string.
|
||
|
|
||
|
- If you not certain what we are talking about, there is a rot13 already.
|
||
|
|
||
6 years ago
|
### Expected function
|
||
6 years ago
|
|
||
|
```go
|
||
|
func rot14(str string) string {
|
||
|
|
||
|
}
|
||
|
```
|
||
6 years ago
|
|
||
6 years ago
|
### Usage
|
||
6 years ago
|
|
||
|
Here is a possible [program](TODO-LINK) to test your function :
|
||
|
|
||
|
```go
|
||
|
package main
|
||
|
|
||
|
import (
|
||
|
"github.com/01-edu/z01"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
result := rot14("Hello How are You")
|
||
|
arrayRune := []rune(result)
|
||
|
|
||
|
for _, s := range arrayRune {
|
||
|
z01.PrintRune(s)
|
||
|
}
|
||
|
z01.PrintRune('\n')
|
||
|
}
|
||
|
|
||
|
```
|
||
|
|
||
|
And its output :
|
||
|
|
||
|
```console
|
||
|
student@ubuntu:~/piscine/test$ go build
|
||
|
student@ubuntu:~/piscine/test$ ./test
|
||
|
Vszzc Vck ofs Mci
|
||
|
student@ubuntu:~/piscine/test$
|
||
|
```
|