mirror of https://github.com/01-edu/public.git
2 changed files with 16 additions and 43 deletions
@ -1,47 +1,18 @@ |
|||||||
## ROT 14 |
## comcheck |
||||||
|
|
||||||
### Instructions |
### Instructions |
||||||
|
|
||||||
Write a function `rot14` that returns the string within the parameter but transformed into a rot14 string. |
Write a program `comcheck` that displays on the standard output `Alert!!!` followed by `\n`. |
||||||
|
|
||||||
- If you not certain what we are talking about, there is a rot13 already. |
- If one of the arguments passed in parameter corresponds to the words `01`, `galaxy`, `galaxy 01`. |
||||||
|
|
||||||
### Expected function |
Examples of outputs : |
||||||
|
|
||||||
```go |
|
||||||
func rot14(str string) string { |
|
||||||
|
|
||||||
} |
|
||||||
``` |
|
||||||
|
|
||||||
### Usage |
|
||||||
|
|
||||||
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 |
```console |
||||||
student@ubuntu:~/piscine/test$ go build |
student@ubuntu:~/piscine/comcheck$ go build |
||||||
student@ubuntu:~/piscine/test$ ./test |
student@ubuntu:~/piscine/comcheck$ ./comcheck "I" "Will" "Enter" "the" "galaxy" |
||||||
Vszzc Vck ofs Mci |
Alert!!! |
||||||
student@ubuntu:~/piscine/test$ |
student@ubuntu:~/piscine/comcheck$ ./comcheck "galaxy 01" "do" "you" "hear" "me" |
||||||
|
Alert!!! |
||||||
|
student@ubuntu:~/piscine/comcheck$ |
||||||
``` |
``` |
||||||
|
Loading…
Reference in new issue