From 0d195a11488c471f451d678a7e9a64ef3d124266 Mon Sep 17 00:00:00 2001 From: lee Date: Wed, 28 Aug 2019 15:46:21 +0100 Subject: [PATCH] correcting input given from interns --- subjects/atoibase.en.md | 2 +- subjects/atoibase.fr.md | 2 +- subjects/collatzcountdown.en.md | 2 ++ subjects/collatzcountdown.fr.md | 2 ++ subjects/concatparams.en.md | 3 ++- subjects/displayfile.en.md | 4 ++-- subjects/doop.en.md | 12 ++++-------- subjects/split.en.md | 4 +++- subjects/split.fr.md | 4 +++- subjects/splitwhitespaces.en.md | 4 +++- subjects/splitwhitespaces.fr.md | 4 +++- 11 files changed, 26 insertions(+), 17 deletions(-) diff --git a/subjects/atoibase.en.md b/subjects/atoibase.en.md index f582db427..3d1dde2bf 100644 --- a/subjects/atoibase.en.md +++ b/subjects/atoibase.en.md @@ -41,7 +41,7 @@ func main() { fmt.Println(piscine.AtoiBase("1111101", "01")) fmt.Println(piscine.AtoiBase("7D", "0123456789ABCDEF")) fmt.Println(piscine.AtoiBase("uoi", "choumi")) - fmt.Println(piscine.AtoiBase("bbbbbab", "-ab") + fmt.Println(piscine.AtoiBase("bbbbbab", "-ab")) } ``` diff --git a/subjects/atoibase.fr.md b/subjects/atoibase.fr.md index 165115ade..2993c7fb0 100644 --- a/subjects/atoibase.fr.md +++ b/subjects/atoibase.fr.md @@ -41,7 +41,7 @@ func main() { fmt.Println(piscine.AtoiBase("1111101", "01")) fmt.Println(piscine.AtoiBase("7D", "0123456789ABCDEF")) fmt.Println(piscine.AtoiBase("uoi", "choumi")) - fmt.Println(piscine.AtoiBase("bbbbbab", "-ab") + fmt.Println(piscine.AtoiBase("bbbbbab", "-ab")) } ``` diff --git a/subjects/collatzcountdown.en.md b/subjects/collatzcountdown.en.md index 02607c56e..9c34bf723 100644 --- a/subjects/collatzcountdown.en.md +++ b/subjects/collatzcountdown.en.md @@ -4,6 +4,8 @@ Write a function, `CollatzCountdown`, that returns the number of steps necessary to reach 1 using the collatz countdown. +- It must return `-1` if `start` is 0 or negative. + ### Expected function ```go diff --git a/subjects/collatzcountdown.fr.md b/subjects/collatzcountdown.fr.md index 9d150d82d..49ba0eb61 100644 --- a/subjects/collatzcountdown.fr.md +++ b/subjects/collatzcountdown.fr.md @@ -4,6 +4,8 @@ Écrire une fonction, `CollatzCountdown`, qui retournes le nombre d'étapes nécéssaires pour atteindre 1 en utilisant le comptage de collatz. +- Il doit renvoyer `-1` si `start` est égal à 0 ou négatif. + ### FOnction attendue ```go diff --git a/subjects/concatparams.en.md b/subjects/concatparams.en.md index b9425ecdb..2aa469d90 100644 --- a/subjects/concatparams.en.md +++ b/subjects/concatparams.en.md @@ -2,7 +2,7 @@ ### Instructions -Write a function that takes the arguments reveived in parameters and returns them as a `string`. +Write a function that takes the arguments received in parameters and returns them as a `string`. The arguments must be **separated** by a `\n`. @@ -10,6 +10,7 @@ The arguments must be **separated** by a `\n`. ```go func ConcatParams(args []string) string { + } ``` diff --git a/subjects/displayfile.en.md b/subjects/displayfile.en.md index 97153fc1f..525b835a9 100644 --- a/subjects/displayfile.en.md +++ b/subjects/displayfile.en.md @@ -4,7 +4,7 @@ Write a program that displays, on the standard output, the content of a file given as argument. -- Create a file `quest8.txt` and write nito it the sentence `Almost there!!` +- Create a file `quest8.txt` and write into it the sentence `Almost there!!` - The argument of the program in this case should be, `quest8.txt`. @@ -12,7 +12,7 @@ Write a program that displays, on the standard output, the content of a file giv - `File name missing`. - `Too many arguments`. -### Usage: +### Usage : ```console student@ubuntu:~/student/displayfile$ go build diff --git a/subjects/doop.en.md b/subjects/doop.en.md index d0c5a914f..6ac73b678 100644 --- a/subjects/doop.en.md +++ b/subjects/doop.en.md @@ -23,18 +23,14 @@ The program has to handle the modulo and division operations by 0 as shown on th ```console student@ubuntu:~/piscine/test$ go build doop.go student@ubuntu:~/piscine/test$ ./doop -student@ubuntu:~/piscine/test$ ./doop 1 + 1 -2 +student@ubuntu:~/piscine/test$ ./doop 1 + 1 | cat -e +2$ student@ubuntu:~/piscine/test$ ./doop hello + 1 | cat -e 0$ -student@ubuntu:~/piscine/test$ ./doop 1 p 1 -0 -student@ubuntu:~/piscine/test$ ./doop 1 + 1 -2 +student@ubuntu:~/piscine/test$ ./doop 1 p 1 | cat -e +0$ student@ubuntu:~/piscine/test$ ./doop 1 / 0 | cat -e No division by 0$ student@ubuntu:~/piscine/test$ ./doop 1 % 0 | cat -e No modulo by 0$ -student@ubuntu:~/piscine/test$ ./doop 1 "*" 1 -1 ``` diff --git a/subjects/split.en.md b/subjects/split.en.md index cc5f31baa..91f1aa5c2 100644 --- a/subjects/split.en.md +++ b/subjects/split.en.md @@ -10,6 +10,7 @@ The separators are the characters of the `charset string` given in parameter. ```go func Split(str, charset string) []string { + } ``` @@ -27,7 +28,8 @@ import ( func main() { str := "HelloHAhowHAareHAyou?" - fmt.Println(piscine.Split(str, charset, "HA")} + fmt.Println(piscine.Split(str, "HA")) +} ``` And its output : diff --git a/subjects/split.fr.md b/subjects/split.fr.md index 641ca5fb1..4dabfc6f7 100644 --- a/subjects/split.fr.md +++ b/subjects/split.fr.md @@ -10,6 +10,7 @@ Les séparateurs sont les caractères de la `string charset` donnée en paramét ```go func Split(str, charset string) []string { + } ``` @@ -27,7 +28,8 @@ import ( func main() { str := "HelloHAhowHAareHAyou?" - fmt.Println(piscine.Split(str, "HA")} + fmt.Println(piscine.Split(str, "HA")) +} ``` Et son résultat : diff --git a/subjects/splitwhitespaces.en.md b/subjects/splitwhitespaces.en.md index e358921e8..10cf1f9ca 100644 --- a/subjects/splitwhitespaces.en.md +++ b/subjects/splitwhitespaces.en.md @@ -10,6 +10,7 @@ The separators are spaces, tabs and newlines. ```go func SplitWhiteSpaces(str string) []string { + } ``` @@ -27,7 +28,8 @@ import ( func main() { str := "Hello how are you?" - fmt.Println(piscine.SplitWhiteSpaces(str)} + fmt.Println(piscine.SplitWhiteSpaces(str)) +} ``` And its output : diff --git a/subjects/splitwhitespaces.fr.md b/subjects/splitwhitespaces.fr.md index 0f9776e19..da235c0a1 100644 --- a/subjects/splitwhitespaces.fr.md +++ b/subjects/splitwhitespaces.fr.md @@ -10,6 +10,7 @@ Les séparateurs sont les espaces, les tabulations et les retours à la ligne. ```go func SplitWhiteSpaces(str string) []string { + } ``` @@ -27,7 +28,8 @@ import ( func main() { str := "Hello how are you?" - fmt.Println(piscine.SplitWhiteSpaces(str)} + fmt.Println(piscine.SplitWhiteSpaces(str)) +} ``` Et son résultat :