From 0d195a11488c471f451d678a7e9a64ef3d124266 Mon Sep 17 00:00:00 2001 From: lee Date: Wed, 28 Aug 2019 15:46:21 +0100 Subject: [PATCH 01/47] 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 f582db42..3d1dde2b 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 165115ad..2993c7fb 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 02607c56..9c34bf72 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 9d150d82..49ba0eb6 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 b9425ecd..2aa469d9 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 97153fc1..525b835a 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 d0c5a914..6ac73b67 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 cc5f31ba..91f1aa5c 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 641ca5fb..4dabfc6f 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 e358921e..10cf1f9c 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 0f9776e1..da235c0a 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 : From f6097d1cb6980c687a7a838db6c272e86aec9b84 Mon Sep 17 00:00:00 2001 From: lee Date: Mon, 16 Sep 2019 12:07:15 +0100 Subject: [PATCH 02/47] correcting the rectangle readme --- subjects/rectangle.en.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/subjects/rectangle.en.md b/subjects/rectangle.en.md index 44b38808..aea0ef10 100644 --- a/subjects/rectangle.en.md +++ b/subjects/rectangle.en.md @@ -12,10 +12,8 @@ is defined by the points of the upper left and lower right corners. - The struct `rectangle` has to have two variables, `upLeft` and `downRight` type `point`. - Our main task is to make a program that: - - - Given a slice of points of size `n` returns the smallest rectangle that contains all the points in the vector of points. The name of that function is `defineRectangle` - - - And calculates and prints the area of that rectangle you define. + - Given a slice of points of size `n` returns the smallest rectangle that contains all the points in the vector of points. The name of that function is `defineRectangle`. + - And calculates and prints the area of that rectangle you define. ### Expected main and function for the program From a91bb0178255ddf14f9d8de8cfdd09ee69ac147b Mon Sep 17 00:00:00 2001 From: lee Date: Mon, 23 Sep 2019 09:54:56 +0100 Subject: [PATCH 03/47] correction of appear --- subjects/to-git-or-not-to-git.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/to-git-or-not-to-git.en.md b/subjects/to-git-or-not-to-git.en.md index c312c410..6970632c 100644 --- a/subjects/to-git-or-not-to-git.en.md +++ b/subjects/to-git-or-not-to-git.en.md @@ -3,7 +3,7 @@ ### Instructions Write in a file `to-git-or-not-to-git.sh` the command that isolates your `gitHub id`. -Only the numbers will appears. +Only the numbers will appear. ### Usage From 774321d184544e415f5deeecf74ba1d2c876d696 Mon Sep 17 00:00:00 2001 From: LEEDASILVA <39002521+LEEDASILVA@users.noreply.github.com> Date: Fri, 27 Sep 2019 12:09:20 +0100 Subject: [PATCH 04/47] Update doop.en.md --- subjects/doop.en.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/subjects/doop.en.md b/subjects/doop.en.md index ba030cd9..1e55cfd8 100644 --- a/subjects/doop.en.md +++ b/subjects/doop.en.md @@ -21,18 +21,18 @@ The program has to handle the modulo and division operations by 0 as shown on th ### Usage ```console -student@ubuntu:~/piscine/test$ go build doop.go -student@ubuntu:~/piscine/test$ ./doop -student@ubuntu:~/piscine/test$ ./doop 1 + 1 | cat -e +student@ubuntu:~/piscine-go/test$ go build doop.go +student@ubuntu:~/piscine-go/test$ ./doop +student@ubuntu:~/piscine-go/test$ ./doop 1 + 1 | cat -e 2$ -student@ubuntu:~/piscine/test$ ./doop hello + 1 | cat -e +student@ubuntu:~/piscine-go/test$ ./doop hello + 1 | cat -e 0$ -student@ubuntu:~/piscine/test$ ./doop 1 p 1 | cat -e +student@ubuntu:~/piscine-go/test$ ./doop 1 p 1 | cat -e 0$ -student@ubuntu:~/piscine/test$ ./doop 1 / 0 | cat -e +student@ubuntu:~/piscine-go/test$ ./doop 1 / 0 | cat -e No division by 0$ student@ubuntu:~/piscine-go/test$ ./doop 1 % 0 | cat -e No modulo by 0$ student@ubuntu:~/piscine-go/test$ ./doop 1 "*" 1 1 -``` \ No newline at end of file +``` From f2b14ec93bc400cef832d4eadecdae7f77d34de0 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Wed, 2 Oct 2019 01:04:41 +0100 Subject: [PATCH 05/47] Update printcombn.fr.md --- subjects/printcombn.fr.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subjects/printcombn.fr.md b/subjects/printcombn.fr.md index 4712d665..8f0a1c9f 100644 --- a/subjects/printcombn.fr.md +++ b/subjects/printcombn.fr.md @@ -39,10 +39,10 @@ func main() { Et son résultat : ```console -student@ubuntu:~/piscine/test$ go build -student@ubuntu:~/piscine/test$ ./test +student@ubuntu:~/piscine-go/test$ go build +student@ubuntu:~/piscine-go/test$ ./test 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 -01, 02, 03, 04, 05, 06, 07, 08, 09, 12, 13, 14, 15, 16, 17, 18, 19, 23, 24, 25, 26, 27, 28, 29, 34, 35, 36, 37, 38, 39, 45, 46, 47, 48, 49, 56, 57, 58, 59, 67, 68, 69, 78, 79, 89 -012, 013, 014, 015, 016, 017, 018, 019, 023, 024, 025, 026, 027, 028, 029, 034, 035, 036, 037, 038, 039, 045, 046, 047, 048, 049, 056, 057, 058, 059, 067, 068, 069, 078, 079, 089, 123, 124, 125, 126, 127, 128, 129, 134, 135, 136, 137, 138, 139, 145, 146, 147, 148, 149, 156, 157, 158, 159, 167, 168, 169, 178, 179, 189, 234, 235, 236, 237, 238, 239, 245, 246, 247, 248, 249, 256, 257, 258, 259, 267, 268, 269, 278, 279, 289, 345, 346, 347, 348, 349, 356, 357, 358, 359, 367, 368, 369, 378, 379, 389, 456, 457, 458, 459, 467, 468, 469, 478, 479, 489, 567, 568, 569, 578, 579, 589, 678, 679, 689, 789 -student@ubuntu:~/piscine/test$ +012, 013, 014, 015, 016, 017, 018, ... 679, 689, 789 +012345678, 012345679, ..., 123456789 +student@ubuntu:~/piscine-go/test$ ``` From 84696026f8a76fc59475344a18bbfe166705b303 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Wed, 2 Oct 2019 02:46:34 +0100 Subject: [PATCH 06/47] review of corrections and translation of rectangle subject --- subjects/collatzcountdown.en.md | 2 +- subjects/collatzcountdown.fr.md | 10 +++++----- subjects/doop.fr.md | 24 ++++++++++-------------- subjects/rectangle.en.md | 6 +++--- subjects/rectangle.fr.md | 19 ++++++++----------- subjects/split.fr.md | 2 +- 6 files changed, 28 insertions(+), 35 deletions(-) diff --git a/subjects/collatzcountdown.en.md b/subjects/collatzcountdown.en.md index bd67c2b0..fd380d7d 100644 --- a/subjects/collatzcountdown.en.md +++ b/subjects/collatzcountdown.en.md @@ -4,7 +4,7 @@ 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. +- It must return `-1` if `start` is equal to `0` or negative. ### Expected function diff --git a/subjects/collatzcountdown.fr.md b/subjects/collatzcountdown.fr.md index 49ba0eb6..38682cf7 100644 --- a/subjects/collatzcountdown.fr.md +++ b/subjects/collatzcountdown.fr.md @@ -4,9 +4,9 @@ É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. +- Elle doit renvoyer `-1` si `start` est égal à 0 ou négatif. -### FOnction attendue +### Fonction attendue ```go func CollatzCountdown(start int) int { @@ -35,8 +35,8 @@ func main() { Et son résultat : ```console -student@ubuntu:~/student/test$ go build -student@ubuntu:~/student/test$ ./test +student@ubuntu:~/piscine-go/test$ go build +student@ubuntu:~/piscine-go/test$ ./test 10 -student@ubuntu:~/student/test$ +student@ubuntu:~/piscine-go/test$ ``` diff --git a/subjects/doop.fr.md b/subjects/doop.fr.md index 8f799ea1..b9201030 100644 --- a/subjects/doop.fr.md +++ b/subjects/doop.fr.md @@ -10,12 +10,11 @@ Le programme doit être utilisé avec trois arguments: - Un opérateur - Une autre valeur - En cas d'opérateur invalide le programme affiche `0`. En cas de nombre invalide d'arguments le programme affiche rien. -Le programme doit géré les opérations modulo et division par 0 comme dans les examples ci-dessous. +Le programme doit géré les opérations modulo et division par 0 comme dans les examples ci-dessous. `fmt.Print` est autorisé. @@ -24,19 +23,16 @@ Le programme doit géré les opérations modulo et division par 0 comme dans les ```console student@ubuntu:~/piscine-go/test$ go build doop.go student@ubuntu:~/piscine-go/test$ ./doop -student@ubuntu:~/piscine-go/test$ ./doop 1 + 1 -2 +student@ubuntu:~/piscine-go/test$ ./doop 1 + 1 | cat -e +2$ student@ubuntu:~/piscine-go/test$ ./doop hello + 1 | cat -e 0$ -student@ubuntu:~/piscine-go/test$ ./doop 1 p 1 -0 -student@ubuntu:~/piscine-go/test$ ./doop 1 + 1 -2 -student@ubuntu:~/piscine-go/test$ ./doop 1 / 0 -No division by 0 -student@ubuntu:~/piscine-go/test$ ./doop 1 % 0 -No modulo by 0 -student@ubuntu:~/piscine-go/test$ ./doop 1 * 1 +student@ubuntu:~/piscine-go/test$ ./doop 1 p 1 | cat -e +0$ +student@ubuntu:~/piscine-go/test$ ./doop 1 / 0 | cat -e +No division by 0$ +student@ubuntu:~/piscine-go/test$ ./doop 1 % 0 | cat -e +No modulo by 0$ +student@ubuntu:~/piscine-go/test$ ./doop 1 "*" 1 1 - ``` diff --git a/subjects/rectangle.en.md b/subjects/rectangle.en.md index 287e9a6d..bee1bf2f 100644 --- a/subjects/rectangle.en.md +++ b/subjects/rectangle.en.md @@ -11,9 +11,9 @@ is defined by the points of the upper left and lower right corners. - The struct `rectangle` has to have two variables, `upLeft` and `downRight` type `point`. -- Our main task is to make a program that: - - Given a slice of points of size `n` returns the smallest rectangle that contains all the points in the vector of points. The name of that function is `defineRectangle`. - - And calculates and prints the area of that rectangle you define. +- The goal is to make a program that: + - Given a slice of points of size `n` returns the smallest rectangle that contains all the points in the vector of points. The name of that function is `defineRectangle`. + - And which calculates and prints the area of that rectangle you define. ### Expected main and function for the program diff --git a/subjects/rectangle.fr.md b/subjects/rectangle.fr.md index 7fb3197c..33dea8f0 100644 --- a/subjects/rectangle.fr.md +++ b/subjects/rectangle.fr.md @@ -2,22 +2,19 @@ ### Instructions -Consider that a point is defined by its coordinates and that a rectangle -is defined by the points of the upper left and lower right corners. +Considérer qu'un point est défini par ses coordonnées et qu'un rectangle est défini par les points de son coin du haut à gauche et son coin du bas à droite. -- Define two structures named, `point` and `rectangle`. +- Définir deux structures nommées, `point` et `rectangle`. -- The struct `point` has to have two variables, `x` and `y`, type `int`. +- La structure `point` doit avoir deux variables, `x` et `y`, de type `int`. -- The struct `rectangle` has to have two variables, `upLeft` and `downRight` type `point`. +- La structure `rectangle` doit avoir deux variables, `upLeft` et `downRight` de type `point`. -- Our main task is to make a program that: +- Le but est de faire un programme qui: + - Avec une slice de points donnée de taille `n` retournes le plus petit rectangle qui contient tous les points dans le vecteur de points0. Le nom de cette fonction est `defineRectangle`. + - Et qui calcules et affiche l'airethe de ce rectangle défini. - - Given a slice of points of size `n` returns the smallest rectangle that contains all the points in the vector of points. The name of that function is `defineRectangle` - - - And calculates and prints the area of that rectangle you define. - -### Expected main and function for the program +### Main et fonctions attendues pour ce programme ```go func defineRectangle(ptr *point, n int) *rectangle { diff --git a/subjects/split.fr.md b/subjects/split.fr.md index 3ffdf089..1d154418 100644 --- a/subjects/split.fr.md +++ b/subjects/split.fr.md @@ -4,7 +4,7 @@ Écrire une fonction qui sépare les mots d'une `string` et les met dans un tableau de `string`. -Les séparateurs sont les caractères de la `string charset` donnée en paramétre. +Les séparateurs sont les caractères de la `string charset` donnée en paramètre. ### Fonction attendue From 29e68b61a1c917e15d392dcb26c86341982916ba Mon Sep 17 00:00:00 2001 From: Augusto Date: Tue, 1 Oct 2019 19:42:11 +0100 Subject: [PATCH 07/47] readme for firstrune program in the exam --- subjects/firstruneprog.en.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 subjects/firstruneprog.en.md diff --git a/subjects/firstruneprog.en.md b/subjects/firstruneprog.en.md new file mode 100644 index 00000000..578d9127 --- /dev/null +++ b/subjects/firstruneprog.en.md @@ -0,0 +1,19 @@ +## firstruneprog + +### Instructions + +Write a program that receives a `string` and returns the first `rune` of that `string`. + +### Expected output : + +```console +student@ubuntu:~/piscine-go/firstruneprog$ go build +student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "this is not happening" +t +student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "hello" +h +student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "this" "is" "not" "happening" +student@ubuntu:~/piscine-go/firstruneprog$ +student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog +student@ubuntu:~/piscine-go/firstruneprog$ +``` From 484cfbe6443d885979e345eb36caf2f6ffd070a1 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Wed, 2 Oct 2019 04:04:05 +0100 Subject: [PATCH 08/47] corrected and created fr version of firstruneprg --- subjects/firstruneprog.en.md | 4 ++-- subjects/firstruneprog.fr.md | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 subjects/firstruneprog.fr.md diff --git a/subjects/firstruneprog.en.md b/subjects/firstruneprog.en.md index 578d9127..41005f00 100644 --- a/subjects/firstruneprog.en.md +++ b/subjects/firstruneprog.en.md @@ -10,8 +10,8 @@ Write a program that receives a `string` and returns the first `rune` of that `s student@ubuntu:~/piscine-go/firstruneprog$ go build student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "this is not happening" t -student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "hello" -h +student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "hello" | cat-e +h$ student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "this" "is" "not" "happening" student@ubuntu:~/piscine-go/firstruneprog$ student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog diff --git a/subjects/firstruneprog.fr.md b/subjects/firstruneprog.fr.md new file mode 100644 index 00000000..771d35e3 --- /dev/null +++ b/subjects/firstruneprog.fr.md @@ -0,0 +1,19 @@ +## firstruneprog + +### Instructions + +Écrire un programme qui reçoit une `string` et qui retourne la première `rune` de cette `string`. + +### Utilisation : + +```console +student@ubuntu:~/piscine-go/firstruneprog$ go build +student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "this is not happening" +t +student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "hello" | cat-e +h$ +student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "this" "is" "not" "happening" +student@ubuntu:~/piscine-go/firstruneprog$ +student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog +student@ubuntu:~/piscine-go/firstruneprog$ +``` From 62f56d89f4da1b21d89bc3bad6df94f67a2af34b Mon Sep 17 00:00:00 2001 From: Augusto Date: Tue, 1 Oct 2019 23:08:23 +0100 Subject: [PATCH 09/47] strrev program for the exams --- subjects/strrevprog.en.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 subjects/strrevprog.en.md diff --git a/subjects/strrevprog.en.md b/subjects/strrevprog.en.md new file mode 100644 index 00000000..2d60ef7c --- /dev/null +++ b/subjects/strrevprog.en.md @@ -0,0 +1,15 @@ +## strrevprog + +### Instructions + +- Write a program that reverses a `string` and writes it in standard output. + +### Expected output : + +```console +student@ubuntu:~/piscine-go/strrevprog$ go build +student@ubuntu:~/piscine-go/strrevprog$ ./strrevprog "Hello World!" +!dlroW olleH +student@ubuntu:~/piscine-go/strrevprog$ ./strrevprog +student@ubuntu:~/piscine-go/strrevprog$ +``` From f8e6f1a61475f3d51e4b2f27f8bb70d20f63314e Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Wed, 2 Oct 2019 06:09:41 +0100 Subject: [PATCH 10/47] commit of fix and fr version of strrevprog --- subjects/strrevprog.en.md | 6 +++--- subjects/strrevprog.fr.md | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 subjects/strrevprog.fr.md diff --git a/subjects/strrevprog.en.md b/subjects/strrevprog.en.md index 2d60ef7c..ebda9a44 100644 --- a/subjects/strrevprog.en.md +++ b/subjects/strrevprog.en.md @@ -2,14 +2,14 @@ ### Instructions -- Write a program that reverses a `string` and writes it in standard output. +- Write a program that reverses a `string` and prints it in the standard output. ### Expected output : ```console student@ubuntu:~/piscine-go/strrevprog$ go build -student@ubuntu:~/piscine-go/strrevprog$ ./strrevprog "Hello World!" -!dlroW olleH +student@ubuntu:~/piscine-go/strrevprog$ ./strrevprog "Hello World!" | cat -e +!dlroW olleH$ student@ubuntu:~/piscine-go/strrevprog$ ./strrevprog student@ubuntu:~/piscine-go/strrevprog$ ``` diff --git a/subjects/strrevprog.fr.md b/subjects/strrevprog.fr.md new file mode 100644 index 00000000..4a1f6241 --- /dev/null +++ b/subjects/strrevprog.fr.md @@ -0,0 +1,15 @@ +## strrevprog + +### Instructions + +- Écrire un programme qui inverse une `string` et qui l'affiche dans la sortie standard. + +### Utilisation : + +```console +student@ubuntu:~/piscine-go/strrevprog$ go build +student@ubuntu:~/piscine-go/strrevprog$ ./strrevprog "Hello World!" | cat -e +!dlroW olleH$ +student@ubuntu:~/piscine-go/strrevprog$ ./strrevprog +student@ubuntu:~/piscine-go/strrevprog$ +``` From fce3dd3a37071e970532f0dc1a453b751c142237 Mon Sep 17 00:00:00 2001 From: Xavier Petit <32063953+xpetit@users.noreply.github.com> Date: Wed, 2 Oct 2019 15:03:51 +0100 Subject: [PATCH 11/47] Add PC requirements for schools --- docs/pc-requirements.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 docs/pc-requirements.md diff --git a/docs/pc-requirements.md b/docs/pc-requirements.md new file mode 100644 index 00000000..4cd49f6f --- /dev/null +++ b/docs/pc-requirements.md @@ -0,0 +1,17 @@ +# PC requirements + +**Linux compatible only** + +| Component | Minimum specifications | +| ----------- | ----------------------- | +| Processor | x86-64 (64 bits) | +| Memory | 8 GB | +| Disk | 120 GB SSD | +| Monitor | Full HD resolution | +| Motherboard | UEFI & PXE boot support | + +## Other considerations + +- The monitor must be flicker-free (no PWM) to preserve the student's attention & eye health +- To avoid damaging the PC ports, all cables (USB, Audio) must be connected to cheaper and easier to replace extension cables. +- Energy consumption is an important criterion to be taken into account From 2dfd6f523d0ff9bf046603041d54e50ecb4878ac Mon Sep 17 00:00:00 2001 From: Xavier Petit <32063953+xpetit@users.noreply.github.com> Date: Wed, 2 Oct 2019 16:44:16 +0100 Subject: [PATCH 12/47] Add tip --- docs/pc-requirements.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/pc-requirements.md b/docs/pc-requirements.md index 4cd49f6f..07bfa5f5 100644 --- a/docs/pc-requirements.md +++ b/docs/pc-requirements.md @@ -15,3 +15,4 @@ - The monitor must be flicker-free (no PWM) to preserve the student's attention & eye health - To avoid damaging the PC ports, all cables (USB, Audio) must be connected to cheaper and easier to replace extension cables. - Energy consumption is an important criterion to be taken into account +- It is better to buy computer without a Windows licence, as it is an unnecessary extra cost. From b726c318431494f6c8f27e635eaeb8538e2df3f2 Mon Sep 17 00:00:00 2001 From: Xavier Petit <32063953+xpetit@users.noreply.github.com> Date: Wed, 2 Oct 2019 16:46:18 +0100 Subject: [PATCH 13/47] Update pc-requirements.md --- docs/pc-requirements.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/pc-requirements.md b/docs/pc-requirements.md index 07bfa5f5..cd6bc4a1 100644 --- a/docs/pc-requirements.md +++ b/docs/pc-requirements.md @@ -12,7 +12,7 @@ ## Other considerations -- The monitor must be flicker-free (no PWM) to preserve the student's attention & eye health +- The monitor must be flicker-free (no PWM) to preserve the student's attention & eye health. - To avoid damaging the PC ports, all cables (USB, Audio) must be connected to cheaper and easier to replace extension cables. -- Energy consumption is an important criterion to be taken into account -- It is better to buy computer without a Windows licence, as it is an unnecessary extra cost. +- Energy consumption is an important criterion to be taken into account. +- It is better to buy the computers without a Windows licence, as it is an unnecessary extra cost. From 4ed37c16bd1cbc46e1aef63c085525d5901ead93 Mon Sep 17 00:00:00 2001 From: Augusto Date: Tue, 1 Oct 2019 18:19:30 +0100 Subject: [PATCH 14/47] reverse bits in exam --- subjects/reversebits.en.md | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/subjects/reversebits.en.md b/subjects/reversebits.en.md index 89181222..af286c78 100644 --- a/subjects/reversebits.en.md +++ b/subjects/reversebits.en.md @@ -2,26 +2,20 @@ ### Instructions -Write a function that takes a `byte`, that reverses it `bit` by `bit` (like the -example) and that returns the result. +Write a program that takes a `byte` in binary format and that reverses it `bit` by `bit` (like the +example) -### Expected function +### Expected output -```go -func ReverseBits(octet byte) byte { - -} -``` - -Example: - -1 byte - ---- - -``` -00100110 - || - \/ +```console +student@ubuntu:~/piscine-go/reversebits$ go build +student@ubuntu:~/piscine-go/reversebits$ ./reversebits +Not enough arguments. +student@ubuntu:~/piscine-go/reversebits$ ./reversebits 00100110 01100100 +student@ubuntu:~/piscine-go/reversebits$ ./reversebits "djs" +The argument "djs" doesn't represent a byte +student@ubuntu:~/piscine-go/reversebits$ ./reversebits "0102039s" +The argument "0102039s" doesn't represent a byte +student@ubuntu:~/piscine-go/reversebits$ ``` From a230bc144918adaad6fd659a93f7bc29bc706373 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Thu, 3 Oct 2019 02:14:17 +0100 Subject: [PATCH 15/47] adaptation of fr subject --- subjects/reversebits.en.md | 14 +++++++------- subjects/reversebits.fr.md | 36 +++++++++++++++--------------------- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/subjects/reversebits.en.md b/subjects/reversebits.en.md index af286c78..433e3258 100644 --- a/subjects/reversebits.en.md +++ b/subjects/reversebits.en.md @@ -2,8 +2,8 @@ ### Instructions -Write a program that takes a `byte` in binary format and that reverses it `bit` by `bit` (like the -example) +Write a program that takes a `byte` in binary format, that reverses it `bit` by `bit` (as shown in the +example) and that prints the result. ### Expected output @@ -11,11 +11,11 @@ example) student@ubuntu:~/piscine-go/reversebits$ go build student@ubuntu:~/piscine-go/reversebits$ ./reversebits Not enough arguments. -student@ubuntu:~/piscine-go/reversebits$ ./reversebits 00100110 -01100100 +student@ubuntu:~/piscine-go/reversebits$ ./reversebits 00100110 | cat -e +01100100$ student@ubuntu:~/piscine-go/reversebits$ ./reversebits "djs" -The argument "djs" doesn't represent a byte -student@ubuntu:~/piscine-go/reversebits$ ./reversebits "0102039s" -The argument "0102039s" doesn't represent a byte +The argument "djs" does not represent a byte +student@ubuntu:~/piscine-go/reversebits$ ./reversebits "0102039s" | cat -e +The argument "0102039s" does not represent a byte$ student@ubuntu:~/piscine-go/reversebits$ ``` diff --git a/subjects/reversebits.fr.md b/subjects/reversebits.fr.md index 5277611e..50126970 100644 --- a/subjects/reversebits.fr.md +++ b/subjects/reversebits.fr.md @@ -2,25 +2,19 @@ ### Instructions -Écrire une fonction qui prend un `byte`, qui l'inverse `bit` par `bit` (comme sur l'exemple) et qui retourne le résultat. - -### Fonction attendue - -```go -func ReverseBits(octet byte) byte { - -} -``` - -Exemple: - -1 byte - ---- - -``` -00100110 - || - \/ -01100100 +Écrire un programme qui prend un `byte`, qui l'inverse `bit` par `bit` (comme montré sur l'exemple) et qui affiche le résultat. + +### Utilisation + +```console +student@ubuntu:~/piscine-go/reversebits$ go build +student@ubuntu:~/piscine-go/reversebits$ ./reversebits +Not enough arguments. +student@ubuntu:~/piscine-go/reversebits$ ./reversebits 00100110 | cat -e +01100100$ +student@ubuntu:~/piscine-go/reversebits$ ./reversebits "djs" +The argument "djs" does not represent a byte +student@ubuntu:~/piscine-go/reversebits$ ./reversebits "0102039s" | cat -e +The argument "0102039s" does not represent a byte$ +student@ubuntu:~/piscine-go/reversebits$ ``` From 01a3b337ad14df7deb7fc2a5e8d7818f014b59c4 Mon Sep 17 00:00:00 2001 From: Augusto Date: Tue, 1 Oct 2019 19:58:18 +0100 Subject: [PATCH 16/47] lastrune program for the exam --- subjects/lastruneprog.en.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 subjects/lastruneprog.en.md diff --git a/subjects/lastruneprog.en.md b/subjects/lastruneprog.en.md new file mode 100644 index 00000000..c687e694 --- /dev/null +++ b/subjects/lastruneprog.en.md @@ -0,0 +1,19 @@ +## lastruneprog + +### Instructions + +Write a program that receives a `string` and returns the last `rune` of a `string`. + +### Expected output : + +```console +student@ubuntu:~/piscine-go/firstruneprog$ go build +student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "this is not happening" +g +student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "hello" +o +student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "this" "is" "not" "happening" +student@ubuntu:~/piscine-go/firstruneprog$ +student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog +student@ubuntu:~/piscine-go/firstruneprog$ +``` From 4d923013b019acdcccb6e36cd59a5c16325ca6ca Mon Sep 17 00:00:00 2001 From: Augusto Date: Tue, 1 Oct 2019 21:52:37 +0100 Subject: [PATCH 17/47] nrune program for the exams --- subjects/nruneprog.en.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 subjects/nruneprog.en.md diff --git a/subjects/nruneprog.en.md b/subjects/nruneprog.en.md new file mode 100644 index 00000000..e6aaceba --- /dev/null +++ b/subjects/nruneprog.en.md @@ -0,0 +1,22 @@ +## nruneprog + +### Instructions + +Write a function that returns the nth `rune` of a `string`. + +### Expected output : + +```console +student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" 2 +e +student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" 4 +l +student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" 5 +o +student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" +student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" f +"f" is not an integer value +student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" 9 +Invalid position: "9" in "hello" +student@ubuntu:~/piscine-go/nruneprog$ +``` \ No newline at end of file From 274a135803e1fd0a247c669d840305ad4f4385af Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Wed, 2 Oct 2019 04:55:55 +0100 Subject: [PATCH 18/47] adding of lastruneprogram modification and french version --- subjects/lastruneprog.en.md | 4 ++-- subjects/lastruneprog.fr.md | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 subjects/lastruneprog.fr.md diff --git a/subjects/lastruneprog.en.md b/subjects/lastruneprog.en.md index c687e694..f9d7e2cd 100644 --- a/subjects/lastruneprog.en.md +++ b/subjects/lastruneprog.en.md @@ -10,8 +10,8 @@ Write a program that receives a `string` and returns the last `rune` of a `strin student@ubuntu:~/piscine-go/firstruneprog$ go build student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "this is not happening" g -student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "hello" -o +student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "hello" | cat -e +o$ student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "this" "is" "not" "happening" student@ubuntu:~/piscine-go/firstruneprog$ student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog diff --git a/subjects/lastruneprog.fr.md b/subjects/lastruneprog.fr.md new file mode 100644 index 00000000..e3722527 --- /dev/null +++ b/subjects/lastruneprog.fr.md @@ -0,0 +1,19 @@ +## lastruneprog + +### Instructions + +Écrire un programme qui reçoit une `string` en paramètre et qui retourne la dernière `rune` de la `string`. + +### Utilisation : + +```console +student@ubuntu:~/piscine-go/firstruneprog$ go build +student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "this is not happening" +g +student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "hello" | cat -e +o$ +student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog "this" "is" "not" "happening" +student@ubuntu:~/piscine-go/firstruneprog$ +student@ubuntu:~/piscine-go/firstruneprog$ ./firstruneprog +student@ubuntu:~/piscine-go/firstruneprog$ +``` From d72c4685fc66825961f17c64b41b42b536086113 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Thu, 3 Oct 2019 02:46:55 +0100 Subject: [PATCH 19/47] adptation of nrune subject en and fr --- subjects/nruneprog.en.md | 10 +++++----- subjects/nruneprog.fr.md | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 subjects/nruneprog.fr.md diff --git a/subjects/nruneprog.en.md b/subjects/nruneprog.en.md index e6aaceba..46053782 100644 --- a/subjects/nruneprog.en.md +++ b/subjects/nruneprog.en.md @@ -9,14 +9,14 @@ Write a function that returns the nth `rune` of a `string`. ```console student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" 2 e -student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" 4 -l +student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" 4 | cat -e +l$ student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" 5 o student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" -student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" f -"f" is not an integer value +student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" f | cat -e +"f" is not an integer value$ student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" 9 Invalid position: "9" in "hello" student@ubuntu:~/piscine-go/nruneprog$ -``` \ No newline at end of file +``` diff --git a/subjects/nruneprog.fr.md b/subjects/nruneprog.fr.md new file mode 100644 index 00000000..c664eb70 --- /dev/null +++ b/subjects/nruneprog.fr.md @@ -0,0 +1,22 @@ +## nruneprog + +### Instructions + +Écrire un programme qui reçoit une `string` en paramètre et qui retourne la énième `rune` de la `string`. + +### Utilisation : + +```console +student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" 2 +e +student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" 4 | cat -e +l$ +student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" 5 +o +student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" +student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" f | cat -e +"f" is not an integer value$ +student@ubuntu:~/piscine-go/nruneprog$ ./nruneprog "hello" 9 +Invalid position: "9" in "hello" +student@ubuntu:~/piscine-go/nruneprog$ +``` From 217bc31c69bdbc6452534044787eacb4f3d09075 Mon Sep 17 00:00:00 2001 From: Augusto Date: Tue, 1 Oct 2019 23:33:00 +0100 Subject: [PATCH 20/47] printstr program for the exams --- subjects/printstr.en.md | 2 +- subjects/printstrprog.en.md | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 subjects/printstrprog.en.md diff --git a/subjects/printstr.en.md b/subjects/printstr.en.md index 2c59d379..37d6bbef 100644 --- a/subjects/printstr.en.md +++ b/subjects/printstr.en.md @@ -32,6 +32,6 @@ And its output : ```console student@ubuntu:~/piscine-go/test$ go build student@ubuntu:~/piscine-go/test$ ./test -Hello World!% +Hello World! student@ubuntu:~/piscine-go/test$ ``` diff --git a/subjects/printstrprog.en.md b/subjects/printstrprog.en.md new file mode 100644 index 00000000..a551b6d8 --- /dev/null +++ b/subjects/printstrprog.en.md @@ -0,0 +1,17 @@ +## printstrprog + +### Instructions + +- Write a program that prints one by one the characters of a string pass as an argument of the program. + +### Expected output : + +```console +student@ubuntu:~/piscine-go/printstrprog$ go build +student@ubuntu:~/piscine-go/printstrprog$ ./printstrprog Hello World! +Hello World! +student@ubuntu:~/piscine-go/printstrprog$ ./printstrprog +student@ubuntu:~/piscine-go/printstrprog$ +student@ubuntu:~/piscine-go/printstrprog$ ./printstrprog "Hello" "World" +student@ubuntu:~/piscine-go/printstrprog$ +``` From f7abcd135fb963f34fe760c51f840f50514a9260 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Thu, 3 Oct 2019 03:23:24 +0100 Subject: [PATCH 21/47] subjects updates --- subjects/printstr.en.md | 6 +++--- subjects/printstr.fr.md | 4 ++-- subjects/printstrprog.en.md | 6 +++--- subjects/printstrprog.fr.md | 17 +++++++++++++++++ 4 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 subjects/printstrprog.fr.md diff --git a/subjects/printstr.en.md b/subjects/printstr.en.md index 37d6bbef..a50a22b6 100644 --- a/subjects/printstr.en.md +++ b/subjects/printstr.en.md @@ -2,7 +2,7 @@ ### Instructions -- Write a function that prints one by one the characters of a string on the screen. +- Write a function that prints one by one the characters of a `string` on the screen. ### Expected function @@ -31,7 +31,7 @@ And its output : ```console student@ubuntu:~/piscine-go/test$ go build -student@ubuntu:~/piscine-go/test$ ./test -Hello World! +student@ubuntu:~/piscine-go/test$ ./test | cat -e +Hello World!% student@ubuntu:~/piscine-go/test$ ``` diff --git a/subjects/printstr.fr.md b/subjects/printstr.fr.md index 29ceb631..5900ba01 100644 --- a/subjects/printstr.fr.md +++ b/subjects/printstr.fr.md @@ -2,7 +2,7 @@ ### Instructions -- Écrire une fonction qui affiche un à un les caractères d'une chaîne à l'écran. +- Écrire une fonction qui affiche un à un les caractères d'une `string` à l'écran. ### Fonction attendue @@ -31,7 +31,7 @@ Et son résultat : ```console student@ubuntu:~/piscine-go/test$ go build -student@ubuntu:~/piscine-go/test$ ./test +student@ubuntu:~/piscine-go/test$ ./test | cat -e Hello World!% student@ubuntu:~/piscine-go/test$ ``` diff --git a/subjects/printstrprog.en.md b/subjects/printstrprog.en.md index a551b6d8..8cf79be2 100644 --- a/subjects/printstrprog.en.md +++ b/subjects/printstrprog.en.md @@ -2,14 +2,14 @@ ### Instructions -- Write a program that prints one by one the characters of a string pass as an argument of the program. +- Write a program that prints one by one the characters of a `string` passed as an argument of the program. ### Expected output : ```console student@ubuntu:~/piscine-go/printstrprog$ go build -student@ubuntu:~/piscine-go/printstrprog$ ./printstrprog Hello World! -Hello World! +student@ubuntu:~/piscine-go/printstrprog$ ./printstrprog "Hello World!" | cat -e +Hello World!$ student@ubuntu:~/piscine-go/printstrprog$ ./printstrprog student@ubuntu:~/piscine-go/printstrprog$ student@ubuntu:~/piscine-go/printstrprog$ ./printstrprog "Hello" "World" diff --git a/subjects/printstrprog.fr.md b/subjects/printstrprog.fr.md new file mode 100644 index 00000000..bed63958 --- /dev/null +++ b/subjects/printstrprog.fr.md @@ -0,0 +1,17 @@ +## printstrprog + +### Instructions + +- Écrire un programme qui affiche un à un les caractères d'une `string` passée en argument du programme. + +### Utilisation : + +```console +student@ubuntu:~/piscine-go/printstrprog$ go build +student@ubuntu:~/piscine-go/printstrprog$ ./printstrprog "Hello World!" | cat -e +Hello World!$ +student@ubuntu:~/piscine-go/printstrprog$ ./printstrprog +student@ubuntu:~/piscine-go/printstrprog$ +student@ubuntu:~/piscine-go/printstrprog$ ./printstrprog "Hello" "World" +student@ubuntu:~/piscine-go/printstrprog$ +``` From c2d2586e2ecd854aaa1c95a7538cc187690d72ef Mon Sep 17 00:00:00 2001 From: lee Date: Wed, 2 Oct 2019 10:44:29 +0100 Subject: [PATCH 22/47] rot14 readme for the exams --- subjects/rot14prog.en.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 subjects/rot14prog.en.md diff --git a/subjects/rot14prog.en.md b/subjects/rot14prog.en.md new file mode 100644 index 00000000..68fd3264 --- /dev/null +++ b/subjects/rot14prog.en.md @@ -0,0 +1,18 @@ +## rot14 + +### Instructions + +Write a program that prints the `string` passed as argument, transformed into a `rot14 string`. + +### Usage + +```console +student@ubuntu:~/rot14prog$ go build +student@ubuntu:~/rot14prog$ ./rot14prog "Hello How are You" +Vszzc Vck ofs Mci +student@ubuntu:~/rot14prog$ ./rot14prog Hello How are You + +student@ubuntu:~/rot14prog$ ./rot14prog + +student@ubuntu:~/rot14prog$ +``` From ad061620bcdd763b703951d50528cc3e12427dae Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Thu, 3 Oct 2019 04:03:26 +0100 Subject: [PATCH 23/47] update of rot14 test programs --- subjects/rot14prog.en.md | 4 ++-- subjects/rot14prog.fr.md | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 subjects/rot14prog.fr.md diff --git a/subjects/rot14prog.en.md b/subjects/rot14prog.en.md index 68fd3264..c421a1f7 100644 --- a/subjects/rot14prog.en.md +++ b/subjects/rot14prog.en.md @@ -8,8 +8,8 @@ Write a program that prints the `string` passed as argument, transformed into a ```console student@ubuntu:~/rot14prog$ go build -student@ubuntu:~/rot14prog$ ./rot14prog "Hello How are You" -Vszzc Vck ofs Mci +student@ubuntu:~/rot14prog$ ./rot14prog "Hello How are You" | cat -e +Vszzc Vck ofs Mci$ student@ubuntu:~/rot14prog$ ./rot14prog Hello How are You student@ubuntu:~/rot14prog$ ./rot14prog diff --git a/subjects/rot14prog.fr.md b/subjects/rot14prog.fr.md new file mode 100644 index 00000000..5d3b2736 --- /dev/null +++ b/subjects/rot14prog.fr.md @@ -0,0 +1,18 @@ +## rot14 + +### Instructions + +Écrire un programme qui retourne la `string` en paramètre transformée en `string rot14`.. + +### Utilisation + +```console +student@ubuntu:~/rot14prog$ go build +student@ubuntu:~/rot14prog$ ./rot14prog "Hello How are You" | cat -e +Vszzc Vck ofs Mci$ +student@ubuntu:~/rot14prog$ ./rot14prog Hello How are You + +student@ubuntu:~/rot14prog$ ./rot14prog + +student@ubuntu:~/rot14prog$ +``` From 65b2477ef8a80350923c1e219898ddd5302f6aea Mon Sep 17 00:00:00 2001 From: lee Date: Wed, 2 Oct 2019 12:32:28 +0100 Subject: [PATCH 24/47] change ispowerof2 readme --- subjects/ispowerof2.en.md | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/subjects/ispowerof2.en.md b/subjects/ispowerof2.en.md index 62ddde45..0a3fabb9 100644 --- a/subjects/ispowerof2.en.md +++ b/subjects/ispowerof2.en.md @@ -2,14 +2,27 @@ ### Instructions -Write a function that determines if a given number is a power of 2. +Write a program that determines if a given number is a power of 2. -This function returns `true` if the given number is a power of 2, otherwise it returns `false`. +This program must print `true` if the given number is a power of 2, otherwise it prints `false`. -### Expected function +- If there's no arguments passed to the program or there's more that one it shohuld print `\n`. -```go -func IsPowerOf2(n uint) bool { +- In case of error you shoud handle it. -} -``` +### Expected output : + +```console +student@ubuntu:~/ispowerof2$ go build +student@ubuntu:~/ispowerof2$ ./ispowerof2 2 | cat -e +true$ +student@ubuntu:~/ispowerof2$ ./ispowerof2 64 | cat -e +true$ +student@ubuntu:~/ispowerof2$ ./ispowerof2 513 | cat -e +false$ +student@ubuntu:~/ispowerof2$ ./ispowerof2 + +student@ubuntu:~/ispowerof2$ ./ispowerof2 64 1024 + +student@ubuntu:~/ispowerof2$ +``` \ No newline at end of file From 491cc468efe682f25d2eacac60bdda02f6e63125 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Thu, 3 Oct 2019 04:30:34 +0100 Subject: [PATCH 25/47] review of ispowerof2 en and fr --- subjects/ispowerof2.en.md | 10 ++++++---- subjects/ispowerof2.fr.md | 27 +++++++++++++++++++++------ 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/subjects/ispowerof2.en.md b/subjects/ispowerof2.en.md index 0a3fabb9..b9d8ead2 100644 --- a/subjects/ispowerof2.en.md +++ b/subjects/ispowerof2.en.md @@ -6,11 +6,11 @@ Write a program that determines if a given number is a power of 2. This program must print `true` if the given number is a power of 2, otherwise it prints `false`. -- If there's no arguments passed to the program or there's more that one it shohuld print `\n`. +- If there is more than one or no argument the program should print a newline ("`\n`"). -- In case of error you shoud handle it. +- Error cases have to be handled. -### Expected output : +### Usage : ```console student@ubuntu:~/ispowerof2$ go build @@ -24,5 +24,7 @@ student@ubuntu:~/ispowerof2$ ./ispowerof2 student@ubuntu:~/ispowerof2$ ./ispowerof2 64 1024 +student@ubuntu:~/ispowerof2$ ./ispowerof2 notanumber | cat -e +strconv.Atoi: parsing "a": invalid syntax$ student@ubuntu:~/ispowerof2$ -``` \ No newline at end of file +``` diff --git a/subjects/ispowerof2.fr.md b/subjects/ispowerof2.fr.md index 8147db77..25e5f317 100644 --- a/subjects/ispowerof2.fr.md +++ b/subjects/ispowerof2.fr.md @@ -2,14 +2,29 @@ ### Instructions -Écrire une fonction qui détermine si un nombre donné est une puissance de 2. +Écrire un programme fonction qui détermine si un nombre donné est une puissance de 2. -Cette fonction retourne `true` si le nombre donné est une puissance de 2, autrement elle retourne `false`. +Ce programme doit afficher `true` si le nombre donné est une puissance de 2, autrement il affiche `false`. -### Fonction attendue +- Si il y a plus d'un ou aucun argument le programme doit afficher un newline ("`\n`"). -```go -func IsPowerOf2(n uint) bool { +- Les cas d'erreurs doivent être gérés. -} +### Utilisation : + +```console +student@ubuntu:~/ispowerof2$ go build +student@ubuntu:~/ispowerof2$ ./ispowerof2 2 | cat -e +true$ +student@ubuntu:~/ispowerof2$ ./ispowerof2 64 | cat -e +true$ +student@ubuntu:~/ispowerof2$ ./ispowerof2 513 | cat -e +false$ +student@ubuntu:~/ispowerof2$ ./ispowerof2 + +student@ubuntu:~/ispowerof2$ ./ispowerof2 64 1024 + +student@ubuntu:~/ispowerof2$ ./ispowerof2 notanumber | cat -e +strconv.Atoi: parsing "a": invalid syntax$ +student@ubuntu:~/ispowerof2$ ``` From 9d0171dfb3541550923d5a1b21098f972db7d69b Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Thu, 3 Oct 2019 04:31:52 +0100 Subject: [PATCH 26/47] Update ispowerof2.fr.md --- subjects/ispowerof2.fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/ispowerof2.fr.md b/subjects/ispowerof2.fr.md index 25e5f317..9a266779 100644 --- a/subjects/ispowerof2.fr.md +++ b/subjects/ispowerof2.fr.md @@ -2,7 +2,7 @@ ### Instructions -Écrire un programme fonction qui détermine si un nombre donné est une puissance de 2. +Écrire un programme qui détermine si un nombre donné est une puissance de 2. Ce programme doit afficher `true` si le nombre donné est une puissance de 2, autrement il affiche `false`. From 7e83cc24c073bc0256b919572025fa96fbc7ee6f Mon Sep 17 00:00:00 2001 From: lee Date: Wed, 2 Oct 2019 12:46:32 +0100 Subject: [PATCH 27/47] compareprog readme for the exams --- subjects/compareprog.en.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 subjects/compareprog.en.md diff --git a/subjects/compareprog.en.md b/subjects/compareprog.en.md new file mode 100644 index 00000000..dbfbf2f8 --- /dev/null +++ b/subjects/compareprog.en.md @@ -0,0 +1,24 @@ +## compareprog + +### Instructions + +Write a program that behaves like the `Compare` function. + +This program prints a number comparing two strings lexicographically. + +### Expected output : + +```console +student@ubuntu:~/compareprog$ go build +student@ubuntu:~/compareprog$ ./compareprog a b | cat -e +-1$ +student@ubuntu:~/compareprog$ ./compareprog a a | cat -e +0$ +student@ubuntu:~/compareprog$ ./compareprog b a | cat -e +1$ +student@ubuntu:~/compareprog$ ./compareprog b a d | cat -e +$ +student@ubuntu:~/compareprog$ ./compareprog | cat -e +$ +student@ubuntu:~/compareprog$ +``` From df72f1889e8f217e13d3c6ceb3416528ef9311bb Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Thu, 3 Oct 2019 05:05:16 +0100 Subject: [PATCH 28/47] update of subjects en et fr --- subjects/compareprog.en.md | 4 ++-- subjects/compareprog.fr.md | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 subjects/compareprog.fr.md diff --git a/subjects/compareprog.en.md b/subjects/compareprog.en.md index dbfbf2f8..0d648f30 100644 --- a/subjects/compareprog.en.md +++ b/subjects/compareprog.en.md @@ -4,9 +4,9 @@ Write a program that behaves like the `Compare` function. -This program prints a number comparing two strings lexicographically. +This program prints a number after comparing two `strings` lexicographically. -### Expected output : +### Usage : ```console student@ubuntu:~/compareprog$ go build diff --git a/subjects/compareprog.fr.md b/subjects/compareprog.fr.md new file mode 100644 index 00000000..ebdaf734 --- /dev/null +++ b/subjects/compareprog.fr.md @@ -0,0 +1,24 @@ +## compareprog + +### Instructions + +Écrire un programme qui se comporte comme la fonction `Compare`. + +Ce programme affiche un nombre après avoir comparé deux `strings` lexicalement. + +### Utilisation : + +```console +student@ubuntu:~/compareprog$ go build +student@ubuntu:~/compareprog$ ./compareprog a b | cat -e +-1$ +student@ubuntu:~/compareprog$ ./compareprog a a | cat -e +0$ +student@ubuntu:~/compareprog$ ./compareprog b a | cat -e +1$ +student@ubuntu:~/compareprog$ ./compareprog b a d | cat -e +$ +student@ubuntu:~/compareprog$ ./compareprog | cat -e +$ +student@ubuntu:~/compareprog$ +``` From 52bfbb7d5d443cd2888a97e451450d5129025062 Mon Sep 17 00:00:00 2001 From: lee Date: Wed, 2 Oct 2019 14:26:31 +0100 Subject: [PATCH 29/47] printbits readme for the exams --- subjects/printbits.en.md | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/subjects/printbits.en.md b/subjects/printbits.en.md index 65be83a1..dc9400e3 100644 --- a/subjects/printbits.en.md +++ b/subjects/printbits.en.md @@ -2,18 +2,21 @@ ### Instructions -Write a function that takes a byte, and prints it in binary value **without a newline at the end**. - -### Expected function - -```go -func PrintBits(octe byte) { - -} -``` - -### Usage - -Example of output: - -If 2 is passed to the function `PrintBits`, it will print "00000010". +Write a program that takes a number as argument, and prints it in binary value **without a newline at the end**. + +- If the the argument isn't a number it should print `00000000`. + +### Expected output : + +```console +student@ubuntu:~/printbits$ go build +student@ubuntu:~/printbits$ ./printbits 1 +00000001student@ubuntu:~/printbits$ +student@ubuntu:~/printbits$ ./printbits 192 +11000000student@ubuntu:~/printbits$ +student@ubuntu:~/printbits$ ./printbits a +00000000student@ubuntu:~/printbits$ +student@ubuntu:~/printbits$ ./printbits 1 1 +student@ubuntu:~/printbits$ ./printbits +student@ubuntu:~/printbits$ +``` \ No newline at end of file From 98f811b0beb5924ed3e85d11a6032d64caee0682 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Thu, 3 Oct 2019 05:14:11 +0100 Subject: [PATCH 30/47] subjects update --- subjects/printbits.en.md | 4 ++-- subjects/printbits.fr.md | 31 +++++++++++++++++-------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/subjects/printbits.en.md b/subjects/printbits.en.md index dc9400e3..259e2186 100644 --- a/subjects/printbits.en.md +++ b/subjects/printbits.en.md @@ -4,7 +4,7 @@ Write a program that takes a number as argument, and prints it in binary value **without a newline at the end**. -- If the the argument isn't a number it should print `00000000`. +- If the the argument is not a number the program should print `00000000`. ### Expected output : @@ -19,4 +19,4 @@ student@ubuntu:~/printbits$ ./printbits a student@ubuntu:~/printbits$ ./printbits 1 1 student@ubuntu:~/printbits$ ./printbits student@ubuntu:~/printbits$ -``` \ No newline at end of file +``` diff --git a/subjects/printbits.fr.md b/subjects/printbits.fr.md index 8e546ddd..724a1c24 100644 --- a/subjects/printbits.fr.md +++ b/subjects/printbits.fr.md @@ -2,18 +2,21 @@ ### Instructions -Écrire une fonction qui prend un `byte`, et qui l'affiche en valeur binaire **sans newline à la fin**. - -### Fonction attendue - -```go -func PrintBits(octe byte) { - -} +Écrire un programme qui prend un nombre en argument, et qui l'affiche en valeur binaire **sans newline à la fin**. + +- Si l'argument n'est pas un nombre le programme doit afficher `00000000`. + +### Expected output : + +```console +student@ubuntu:~/printbits$ go build +student@ubuntu:~/printbits$ ./printbits 1 +00000001student@ubuntu:~/printbits$ +student@ubuntu:~/printbits$ ./printbits 192 +11000000student@ubuntu:~/printbits$ +student@ubuntu:~/printbits$ ./printbits a +00000000student@ubuntu:~/printbits$ +student@ubuntu:~/printbits$ ./printbits 1 1 +student@ubuntu:~/printbits$ ./printbits +student@ubuntu:~/printbits$ ``` - -### Usage - -Exemple d'output: - -Si 2 est passé à la fonction `PrintBits`, elle affichera "00000010". From 2f850601b9cb64ed76d13a8ce7aa74247dfc4c18 Mon Sep 17 00:00:00 2001 From: Augusto Date: Wed, 2 Oct 2019 15:09:47 +0100 Subject: [PATCH 31/47] strlen program for the exam --- subjects/strlenprog.en.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 subjects/strlenprog.en.md diff --git a/subjects/strlenprog.en.md b/subjects/strlenprog.en.md new file mode 100644 index 00000000..e0f0ab6e --- /dev/null +++ b/subjects/strlenprog.en.md @@ -0,0 +1,19 @@ +## strlenprog + +### Instructions + +- Write a program that counts the characters of a `string` and that returns that value. + +- If the program receives more than one `string` or no arguments must not return anything (see the `Expected output`). + +### Expected output : + +```console +student@ubuntu:~/piscine-go/strlenprog$ go build +student@ubuntu:~/piscine-go/strlenprog$ ./strlenprog "hello" +5 +student@ubuntu:~/piscine-go/strlenprog$ ./strlenprog +student@ubuntu:~/piscine-go/strlenprog$ +student@ubuntu:~/piscine-go/strlenprog$ ./strlenprog "hello" "how are you" +student@ubuntu:~/piscine-go/strlenprog$ +``` From 1acd1e62530d39de367ee90dbb6733ff3ddca621 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Thu, 3 Oct 2019 05:51:47 +0100 Subject: [PATCH 32/47] update of strlen subjects en and fr --- subjects/strlen.en.md | 2 +- subjects/strlen.fr.md | 2 +- subjects/strlenprog.en.md | 2 +- subjects/strlenprog.fr.md | 19 +++++++++++++++++++ 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 subjects/strlenprog.fr.md diff --git a/subjects/strlen.en.md b/subjects/strlen.en.md index 68618fc9..7f9e2b2c 100644 --- a/subjects/strlen.en.md +++ b/subjects/strlen.en.md @@ -2,7 +2,7 @@ ### Instructions -- Write a function that counts the characters of a string and that returns that count. +- Write a function that counts the characters of a `string` and that returns that count. ### Expected function diff --git a/subjects/strlen.fr.md b/subjects/strlen.fr.md index de4de21f..183355ce 100644 --- a/subjects/strlen.fr.md +++ b/subjects/strlen.fr.md @@ -2,7 +2,7 @@ ### Instructions -- Écrire une fonction qui compte le nombre de caractères d'une chaîne et qui retourne le nombre trouvé. +- Écrire une fonction qui compte le nombre de caractères d'une `string` et qui retourne le nombre trouvé. ### Fonction attendue diff --git a/subjects/strlenprog.en.md b/subjects/strlenprog.en.md index e0f0ab6e..10b755f3 100644 --- a/subjects/strlenprog.en.md +++ b/subjects/strlenprog.en.md @@ -4,7 +4,7 @@ - Write a program that counts the characters of a `string` and that returns that value. -- If the program receives more than one `string` or no arguments must not return anything (see the `Expected output`). +- If the program receives more than one or no arguments it must not print anything. ### Expected output : diff --git a/subjects/strlenprog.fr.md b/subjects/strlenprog.fr.md new file mode 100644 index 00000000..c4ffccfe --- /dev/null +++ b/subjects/strlenprog.fr.md @@ -0,0 +1,19 @@ +## strlenprog + +### Instructions + +- Écrire un programme qui compte le nombre de caractères d'une `string` et qui retourne le nombre trouvé. + +- Si le programme reçoit plusieurs ou aucun arguments il ne doit rien afficher. + +### Utilisation : + +```console +student@ubuntu:~/piscine-go/strlenprog$ go build +student@ubuntu:~/piscine-go/strlenprog$ ./strlenprog "hello" +5 +student@ubuntu:~/piscine-go/strlenprog$ ./strlenprog +student@ubuntu:~/piscine-go/strlenprog$ +student@ubuntu:~/piscine-go/strlenprog$ ./strlenprog "hello" "how are you" +student@ubuntu:~/piscine-go/strlenprog$ +``` From 966693d52b4aa584d5131bbe0ab96b7d2d94832c Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Thu, 3 Oct 2019 05:56:10 +0100 Subject: [PATCH 33/47] Update strlenprog.en.md --- subjects/strlenprog.en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/strlenprog.en.md b/subjects/strlenprog.en.md index 10b755f3..9899252c 100644 --- a/subjects/strlenprog.en.md +++ b/subjects/strlenprog.en.md @@ -10,8 +10,8 @@ ```console student@ubuntu:~/piscine-go/strlenprog$ go build -student@ubuntu:~/piscine-go/strlenprog$ ./strlenprog "hello" -5 +student@ubuntu:~/piscine-go/strlenprog$ ./strlenprog "hello" | cat -e +5$ student@ubuntu:~/piscine-go/strlenprog$ ./strlenprog student@ubuntu:~/piscine-go/strlenprog$ student@ubuntu:~/piscine-go/strlenprog$ ./strlenprog "hello" "how are you" From c4fa8da6fe31c861b601e581e842a5f733bf8d6b Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Thu, 3 Oct 2019 05:56:35 +0100 Subject: [PATCH 34/47] Update strlenprog.fr.md --- subjects/strlenprog.fr.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/strlenprog.fr.md b/subjects/strlenprog.fr.md index c4ffccfe..38e44e77 100644 --- a/subjects/strlenprog.fr.md +++ b/subjects/strlenprog.fr.md @@ -10,8 +10,8 @@ ```console student@ubuntu:~/piscine-go/strlenprog$ go build -student@ubuntu:~/piscine-go/strlenprog$ ./strlenprog "hello" -5 +student@ubuntu:~/piscine-go/strlenprog$ ./strlenprog "hello" | cat -e +5$ student@ubuntu:~/piscine-go/strlenprog$ ./strlenprog student@ubuntu:~/piscine-go/strlenprog$ student@ubuntu:~/piscine-go/strlenprog$ ./strlenprog "hello" "how are you" From a1256eb404dbef9d5985488e623a4b6b10783a75 Mon Sep 17 00:00:00 2001 From: lee Date: Wed, 2 Oct 2019 15:16:39 +0100 Subject: [PATCH 35/47] capitalizeprog readme for the exams --- subjects/capitalizeprog.en.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 subjects/capitalizeprog.en.md diff --git a/subjects/capitalizeprog.en.md b/subjects/capitalizeprog.en.md new file mode 100644 index 00000000..732a90a7 --- /dev/null +++ b/subjects/capitalizeprog.en.md @@ -0,0 +1,24 @@ +## capitalizeprog + +### Instructions + +Write a program that capitalizes the first letter of each word **and** lowercases the rest of each word of a `string`. + +- A word is a sequence of **alphanumerical** characters. + +- If the number of arguments is bigger than one it should print `To many arguments`. + +- If there's no arguments given to the program it should print a new line `\n`. + +### Expected output : + +```console +student@ubuntu:~/capitalizeprog$ go build +student@ubuntu:~/capitalizeprog$ ./capitalizeprog "Hello! How are you? How+are+things+4you?" +Hello! How Are You? How+Are+Things+4you? +student@ubuntu:~/capitalizeprog$ ./capitalizeprog Hello! How are you? +To many arguments +student@ubuntu:~/capitalizeprog$ ./capitalizeprog + +student@ubuntu:~/capitalizeprog$ +``` From e1aa6a3b876067bc9a02cd90e345b4d9127fb780 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Thu, 3 Oct 2019 06:34:00 +0100 Subject: [PATCH 36/47] update of capitalizeprog subjects en and fr --- subjects/capitalizeprog.en.md | 14 +++++++------- subjects/capitalizeprog.fr.md | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 subjects/capitalizeprog.fr.md diff --git a/subjects/capitalizeprog.en.md b/subjects/capitalizeprog.en.md index 732a90a7..0151c867 100644 --- a/subjects/capitalizeprog.en.md +++ b/subjects/capitalizeprog.en.md @@ -6,18 +6,18 @@ Write a program that capitalizes the first letter of each word **and** lowercase - A word is a sequence of **alphanumerical** characters. -- If the number of arguments is bigger than one it should print `To many arguments`. +- If there is more than one argument the program should print `Too many arguments`. -- If there's no arguments given to the program it should print a new line `\n`. +- If there is no arguments given the program should print a newline ("`\n`"). -### Expected output : +### Usage : ```console student@ubuntu:~/capitalizeprog$ go build -student@ubuntu:~/capitalizeprog$ ./capitalizeprog "Hello! How are you? How+are+things+4you?" -Hello! How Are You? How+Are+Things+4you? -student@ubuntu:~/capitalizeprog$ ./capitalizeprog Hello! How are you? -To many arguments +student@ubuntu:~/capitalizeprog$ ./capitalizeprog "Hello! How are you? How+are+things+4you?" | cat -e +Hello! How Are You? How+Are+Things+4you?$ +student@ubuntu:~/capitalizeprog$ ./capitalizeprog Hello! How are you? | cat -e +Too many arguments$ student@ubuntu:~/capitalizeprog$ ./capitalizeprog student@ubuntu:~/capitalizeprog$ diff --git a/subjects/capitalizeprog.fr.md b/subjects/capitalizeprog.fr.md new file mode 100644 index 00000000..301dc19b --- /dev/null +++ b/subjects/capitalizeprog.fr.md @@ -0,0 +1,24 @@ +## capitalizeprog + +### Instructions + +Écrire un programme qui met en majuscule la première lettre de chaque mot et en minuscule les autres lettres du reste du mot d'une `string`. + +- Un mot est une suite de caractères **alphanumériques**. + +- Si il y a plus d'un argument le programme doit afficher `Too many arguments`. + +- Si il n'y a pas d'arguments le programme doit afficher un newline ("`\n`"). + +### Utilisation : + +```console +student@ubuntu:~/capitalizeprog$ go build +student@ubuntu:~/capitalizeprog$ ./capitalizeprog "Hello! How are you? How+are+things+4you?" | cat -e +Hello! How Are You? How+Are+Things+4you?$ +student@ubuntu:~/capitalizeprog$ ./capitalizeprog Hello! How are you? | cat -e +Too many arguments$ +student@ubuntu:~/capitalizeprog$ ./capitalizeprog + +student@ubuntu:~/capitalizeprog$ +``` From 432552369da09ea7ef51352abd1ab413a391408b Mon Sep 17 00:00:00 2001 From: lee Date: Wed, 2 Oct 2019 17:03:26 +0100 Subject: [PATCH 37/47] reverserange readme for the exams --- subjects/reverserange.en.md | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/subjects/reverserange.en.md b/subjects/reverserange.en.md index 489fa9a8..f08abaa3 100644 --- a/subjects/reverserange.en.md +++ b/subjects/reverserange.en.md @@ -2,23 +2,27 @@ ### Instructions -Write the function `ReverseRange` which must: +Write the program which must: -- allocate (with make()) an array of integers. -- fill it with consecutive values that begin at `end` and end at `start` (Including `start` and `end` !) -- and that returns that array. +- **Allocate (with make())** an array of integers. -### Expected function +- Fill it with consecutive values that begins at the second argument and end at the first argument (Including the first and second argument !). -```go -func ReverseRange(start, end int) []int { +- That prints the array. -} -``` +- In case of error you should handle it. -### Usage : +- And if the number of arguments is bigger or lower than 2 it should print `\n`. -- With (1, 3) the function will return an array containing 3, 2 and 1. -- With (-1, 2) the function will return an array containing 2, 1, 0 and -1. -- With (0, 0) the function will return an array containing 0. -- With (0, -3) the function will return an array containing -3, -2, -1 and 0. +### Expected output : + +```console +student@ubuntu:~/reverserange$ go build +student@ubuntu:~/reverserange$ ./reverserange 1 3 +[3 2 1] +student@ubuntu:~/reverserange$ ./reverserange -1 2 +[2 1 0 -1] +student@ubuntu:~/reverserange$ ./reverserange 0 0 +[0] +student@ubuntu:~/reverserange$ +``` \ No newline at end of file From 4e21bb3b460cbea241d349f68863f21f9719afc3 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Thu, 3 Oct 2019 06:53:24 +0100 Subject: [PATCH 38/47] update of reverserange subjects en and fr --- subjects/reverserange.en.md | 16 ++++++++++------ subjects/reverserange.fr.md | 34 +++++++++++++++++++++------------- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/subjects/reverserange.en.md b/subjects/reverserange.en.md index f08abaa3..0d8323c7 100644 --- a/subjects/reverserange.en.md +++ b/subjects/reverserange.en.md @@ -2,7 +2,7 @@ ### Instructions -Write the program which must: +Write a program which must: - **Allocate (with make())** an array of integers. @@ -10,9 +10,9 @@ Write the program which must: - That prints the array. -- In case of error you should handle it. +Errors should be handled. -- And if the number of arguments is bigger or lower than 2 it should print `\n`. +If the number of arguments is different from 2 the program prints a newline ("`\n`"). ### Expected output : @@ -20,9 +20,13 @@ Write the program which must: student@ubuntu:~/reverserange$ go build student@ubuntu:~/reverserange$ ./reverserange 1 3 [3 2 1] -student@ubuntu:~/reverserange$ ./reverserange -1 2 -[2 1 0 -1] +student@ubuntu:~/reverserange$ ./reverserange -1 2 | cat -e +[2 1 0 -1]$ student@ubuntu:~/reverserange$ ./reverserange 0 0 [0] +student@ubuntu:~/reverserange$ ./reverserange 0 -3 +[-3 -2 -1 0] +student@ubuntu:~/reverserange$ ./reverserange 0 nan | cat -e +strconv.Atoi: parsing "nan": invalid syntax$ student@ubuntu:~/reverserange$ -``` \ No newline at end of file +``` diff --git a/subjects/reverserange.fr.md b/subjects/reverserange.fr.md index bb65691d..d8e8f5f0 100644 --- a/subjects/reverserange.fr.md +++ b/subjects/reverserange.fr.md @@ -2,23 +2,31 @@ ### Instructions -Écrire la fonction `ReverseRange` qui doit: +Écrire un programme qui doit: -- allouer (avec make()) une slice d'entiers. -- le remplir avec des valeurs consécutives qui commencent à `end` et qui finissent à `start` (En incluant `start` et `end` !) -- et qui retourne cette slice. +- Allouer (avec make()) une slice d'entiers. -### Fonction attendue +- Le remplir avec des valeurs consécutives qui commencent à `end` et qui finissent à `start` (En incluant `start` et `end` !) -```go -func ReverseRange(start, end int) []int { +- Et qui affiche cette slice. -} -``` +Les erreurs doivent être gérées. + +Si le nombre d'arguments est différent de 2 le programme affiche un newline ("`\n`"). ### Utilisation : -- Avec (1, 3) la fonction devra retourner une slice contenant 3, 2 et 1. -- Avec (-1, 2) la fonction devra retourner une slice contenant 2, 1, 0 et -1. -- Avec (0, 0) la fonction devra retourner une slice contenant 0. -- Avec (0, -3) la fonction devra retourner une slice contenant -3, -2, -1 et 0. +```console +student@ubuntu:~/reverserange$ go build +student@ubuntu:~/reverserange$ ./reverserange 1 3 +[3 2 1] +student@ubuntu:~/reverserange$ ./reverserange -1 2 | cat -e +[2 1 0 -1]$ +student@ubuntu:~/reverserange$ ./reverserange 0 0 +[0] +student@ubuntu:~/reverserange$ ./reverserange 0 -3 +[-3 -2 -1 0] +student@ubuntu:~/reverserange$ ./reverserange 0 nan | cat -e +strconv.Atoi: parsing "nan": invalid syntax$ +student@ubuntu:~/reverserange$ +``` From 984003998d7e63cda5d0d638814f8164122974a1 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Thu, 3 Oct 2019 06:54:26 +0100 Subject: [PATCH 39/47] Update reverserange.en.md --- subjects/reverserange.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/reverserange.en.md b/subjects/reverserange.en.md index 0d8323c7..8eb52e86 100644 --- a/subjects/reverserange.en.md +++ b/subjects/reverserange.en.md @@ -14,7 +14,7 @@ Errors should be handled. If the number of arguments is different from 2 the program prints a newline ("`\n`"). -### Expected output : +### Usage : ```console student@ubuntu:~/reverserange$ go build From 14a1d54fbd933513e3f69f08be5eba9ac55a5216 Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Thu, 3 Oct 2019 07:30:00 +0100 Subject: [PATCH 40/47] Update reverserange.fr.md --- subjects/reverserange.fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/reverserange.fr.md b/subjects/reverserange.fr.md index d8e8f5f0..2acf2f6f 100644 --- a/subjects/reverserange.fr.md +++ b/subjects/reverserange.fr.md @@ -6,7 +6,7 @@ - Allouer (avec make()) une slice d'entiers. -- Le remplir avec des valeurs consécutives qui commencent à `end` et qui finissent à `start` (En incluant `start` et `end` !) +- Le remplir avec des valeurs consécutives qui commencent au deuxième argument et qui finissent au premier (En incluant les valeurs des deux arguments !) - Et qui affiche cette slice. From 05b27913e6d7070e8dfccd82857f093337ec89bb Mon Sep 17 00:00:00 2001 From: Christopher Fremond <34804391+Frenchris@users.noreply.github.com> Date: Thu, 3 Oct 2019 07:30:50 +0100 Subject: [PATCH 41/47] Update reverserange.en.md --- subjects/reverserange.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subjects/reverserange.en.md b/subjects/reverserange.en.md index 8eb52e86..5eb8e79d 100644 --- a/subjects/reverserange.en.md +++ b/subjects/reverserange.en.md @@ -6,7 +6,7 @@ Write a program which must: - **Allocate (with make())** an array of integers. -- Fill it with consecutive values that begins at the second argument and end at the first argument (Including the first and second argument !). +- Fill it with consecutive values that begins at the second argument and end at the first argument (Including the values of thoses arguments !). - That prints the array. From a0f1c996a7d381fb4e6bf479df3d4151f6058937 Mon Sep 17 00:00:00 2001 From: lee Date: Wed, 2 Oct 2019 17:41:58 +0100 Subject: [PATCH 42/47] range readme for the exam --- subjects/range.en.md | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/subjects/range.en.md b/subjects/range.en.md index c1daa749..8909e3db 100644 --- a/subjects/range.en.md +++ b/subjects/range.en.md @@ -2,23 +2,27 @@ ### Instructions -Write the function `Range` which must: +Write the program which must: -- allocate (with make()) an array of integers. -- fill it with consecutive values that begin at `start` and end at `end` (Including `start` and `end` !) -- and that returns that array. +- **Allocate (with make())** an array of integers. -### Expected function +- Fill it with consecutive values that begin at the first argument and end at the second argument (Including first and second !). -```go -func Range(start, end int) []int { +- That prints the array. -} -``` +- In case of error you should handle it. -### Usage +- And if the number of arguments is bigget or lower than 2 it should print `\n`. -- With (1, 3) you will return an array containing 1, 2 and 3. -- With (-1, 2) you will return an array containing -1, 0, 1 and 2. -- With (0, 0) you will return an array containing 0. -- With (0, -3) you will return an array containing 0, -1, -2 and -3. +### Expected output : + +```console +student@ubuntu:~/reverserange$ go build +student@ubuntu:~/reverserange$ ./reverserange 1 3 +[1 2 3] +student@ubuntu:~/reverserange$ ./reverserange -1 2 +[-1 0 1 2] +student@ubuntu:~/reverserange$ ./reverserange 0 0 +[0] +student@ubuntu:~/reverserange$ +``` \ No newline at end of file From 898274a84a549163d55e5adfdb1a411087836ede Mon Sep 17 00:00:00 2001 From: LEEDASILVA <39002521+LEEDASILVA@users.noreply.github.com> Date: Wed, 2 Oct 2019 17:52:58 +0100 Subject: [PATCH 43/47] change the reverserange to range --- subjects/range.en.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/subjects/range.en.md b/subjects/range.en.md index 8909e3db..dcf5ab1b 100644 --- a/subjects/range.en.md +++ b/subjects/range.en.md @@ -17,12 +17,12 @@ Write the program which must: ### Expected output : ```console -student@ubuntu:~/reverserange$ go build -student@ubuntu:~/reverserange$ ./reverserange 1 3 +student@ubuntu:~/range$ go build +student@ubuntu:~/range$ ./range 1 3 [1 2 3] -student@ubuntu:~/reverserange$ ./reverserange -1 2 +student@ubuntu:~/range$ ./range -1 2 [-1 0 1 2] -student@ubuntu:~/reverserange$ ./reverserange 0 0 +student@ubuntu:~/range$ ./range 0 0 [0] -student@ubuntu:~/reverserange$ -``` \ No newline at end of file +student@ubuntu:~/range$ +``` From ecfaf076b7b24b27004356a06a581d1cf7aa619a Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Thu, 3 Oct 2019 07:35:42 +0100 Subject: [PATCH 44/47] update of range subjects en and fr --- subjects/range.en.md | 14 ++++++++------ subjects/range.fr.md | 32 +++++++++++++++++++------------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/subjects/range.en.md b/subjects/range.en.md index dcf5ab1b..116525ef 100644 --- a/subjects/range.en.md +++ b/subjects/range.en.md @@ -2,17 +2,17 @@ ### Instructions -Write the program which must: +Write a program which must: - **Allocate (with make())** an array of integers. -- Fill it with consecutive values that begin at the first argument and end at the second argument (Including first and second !). +- Fill it with consecutive values that begins at the first argument and end at the second argument (Including the values of thoses arguments !). - That prints the array. -- In case of error you should handle it. +Errors should be handled. -- And if the number of arguments is bigget or lower than 2 it should print `\n`. +If the number of arguments is different from 2 the program prints a newline ("`\n`"). ### Expected output : @@ -20,9 +20,11 @@ Write the program which must: student@ubuntu:~/range$ go build student@ubuntu:~/range$ ./range 1 3 [1 2 3] -student@ubuntu:~/range$ ./range -1 2 -[-1 0 1 2] +student@ubuntu:~/range$ ./range -1 2 | cat -e +[-1 0 1 2]$ student@ubuntu:~/range$ ./range 0 0 [0] +student@ubuntu:~/reverserange$ ./reverserange 0 nan | cat -e +strconv.Atoi: parsing "nan": invalid syntax$ student@ubuntu:~/range$ ``` diff --git a/subjects/range.fr.md b/subjects/range.fr.md index 3dccdc99..bf219d81 100644 --- a/subjects/range.fr.md +++ b/subjects/range.fr.md @@ -2,23 +2,29 @@ ### Instructions -Écrire la fonction `Range` qui doit: +Écrire un programme qui doit: -- allouer (avec make()) une slice d'entiers. -- le remplir avec des valeurs consécutives qui commencent à `start` et qui finissent à `end` (En incluant `start` et `end` !) -- et qui retourne cette slice. +- Allouer (avec make()) une slice d'entiers. -### Fonction attendue +- Le remplir avec des valeurs consécutives qui commencent au premier argument et qui finissent au deuxième (En incluant les valeurs des deux arguments !) -```go -func Range(start, end int) []int { +- Et qui affiche cette slice. -} -``` +Les erreurs doivent être gérées. + +Si le nombre d'arguments est différent de 2 le programme affiche un newline ("`\n`"). ### Utilisation -- Avec (1, 3) la fonction devra retourner une slice contenant 1, 2 et 3. -- Avec (-1, 2) la fonction devra retourner une slice contenant -1, 0, 1 et 2. -- Avec (0, 0) la fonction devra retourner une slice contenant 0. -- Avec (0, -3) la fonction devra retourner une slice contenant 0, -1, -2 et -3. +```console +student@ubuntu:~/range$ go build +student@ubuntu:~/range$ ./range 1 3 +[1 2 3] +student@ubuntu:~/range$ ./range -1 2 | cat -e +[-1 0 1 2]$ +student@ubuntu:~/range$ ./range 0 0 +[0] +student@ubuntu:~/reverserange$ ./reverserange 0 nan | cat -e +strconv.Atoi: parsing "nan": invalid syntax$ +student@ubuntu:~/range$ +``` From 05fc779522832a4f8cbdb01b327af61faca524e2 Mon Sep 17 00:00:00 2001 From: Augusto Date: Wed, 2 Oct 2019 22:40:07 +0100 Subject: [PATCH 45/47] split program --- subjects/splitprog.en.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 subjects/splitprog.en.md diff --git a/subjects/splitprog.en.md b/subjects/splitprog.en.md new file mode 100644 index 00000000..cea8a578 --- /dev/null +++ b/subjects/splitprog.en.md @@ -0,0 +1,24 @@ +## splitprog + +### Instructions + +Write a program that separates the words of a `string` and puts them in a `string` array and then prints it to standard output. + +- The program receives two parameters: + + - The first parameter is the `string` + - The second parameter is the `separator` + +### Expected output : + +```console +student@ubuntu:~/piscine-go/splitprog$ go build +student@ubuntu:~/piscine-go/splitprog$ ./splitprog "HelloHAhowHAareHAyou?" HA +[Hello how are you?] +student@ubuntu:~/piscine-go/splitprog$ ./splitprog "Hello,how,are,you?" "," +[Hello how are you?] +student@ubuntu:~/piscine-go/splitprog$ ./splitprog "HelloHAhowHAareHAyou?" +student@ubuntu:~/piscine-go/splitprog$ +student@ubuntu:~/piscine-go/splitprog$ ./splitprog +student@ubuntu:~/piscine-go/splitprog$ +``` From 3d688954f956fcbe241080e4fc2fc8633c8ccbb7 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Thu, 3 Oct 2019 07:55:27 +0100 Subject: [PATCH 46/47] update de splitprog subjects en and fr --- subjects/splitprog.en.md | 12 ++++++------ subjects/splitprog.fr.md | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 subjects/splitprog.fr.md diff --git a/subjects/splitprog.en.md b/subjects/splitprog.en.md index cea8a578..fa97d6d7 100644 --- a/subjects/splitprog.en.md +++ b/subjects/splitprog.en.md @@ -2,19 +2,19 @@ ### Instructions -Write a program that separates the words of a `string` and puts them in a `string` array and then prints it to standard output. +Write a program which separates the words of a `string`, which puts them in a `string` array and which then prints it to standard output. -- The program receives two parameters: +The program receives two parameters: - - The first parameter is the `string` - - The second parameter is the `separator` +- The first is the `string` +- The second is the separator ### Expected output : ```console student@ubuntu:~/piscine-go/splitprog$ go build -student@ubuntu:~/piscine-go/splitprog$ ./splitprog "HelloHAhowHAareHAyou?" HA -[Hello how are you?] +student@ubuntu:~/piscine-go/splitprog$ ./splitprog "HelloHAhowHAareHAyou?" HA | cat -e +[Hello how are you?]$ student@ubuntu:~/piscine-go/splitprog$ ./splitprog "Hello,how,are,you?" "," [Hello how are you?] student@ubuntu:~/piscine-go/splitprog$ ./splitprog "HelloHAhowHAareHAyou?" diff --git a/subjects/splitprog.fr.md b/subjects/splitprog.fr.md new file mode 100644 index 00000000..b6e20946 --- /dev/null +++ b/subjects/splitprog.fr.md @@ -0,0 +1,24 @@ +## splitprog + +### Instructions + +Écrire une fonction qui sépare les mots d'une `string`, qui les met dans un tableau de `string` et qui les affichent sur la sortie standard. + +Le programme reçoit deux paramètres: + +- Le premier est la `string` +- Le deuxième est le séparateur + +### Expected output : + +```console +student@ubuntu:~/piscine-go/splitprog$ go build +student@ubuntu:~/piscine-go/splitprog$ ./splitprog "HelloHAhowHAareHAyou?" HA | cat -e +[Hello how are you?]$ +student@ubuntu:~/piscine-go/splitprog$ ./splitprog "Hello,how,are,you?" "," +[Hello how are you?] +student@ubuntu:~/piscine-go/splitprog$ ./splitprog "HelloHAhowHAareHAyou?" +student@ubuntu:~/piscine-go/splitprog$ +student@ubuntu:~/piscine-go/splitprog$ ./splitprog +student@ubuntu:~/piscine-go/splitprog$ +``` From ab9708d16c86656bfcf684378332f018bd3f5512 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Thu, 3 Oct 2019 07:56:18 +0100 Subject: [PATCH 47/47] typo --- subjects/splitprog.en.md | 2 +- subjects/splitprog.fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/splitprog.en.md b/subjects/splitprog.en.md index fa97d6d7..ef563b64 100644 --- a/subjects/splitprog.en.md +++ b/subjects/splitprog.en.md @@ -9,7 +9,7 @@ The program receives two parameters: - The first is the `string` - The second is the separator -### Expected output : +### Usage : ```console student@ubuntu:~/piscine-go/splitprog$ go build diff --git a/subjects/splitprog.fr.md b/subjects/splitprog.fr.md index b6e20946..3ac1d562 100644 --- a/subjects/splitprog.fr.md +++ b/subjects/splitprog.fr.md @@ -9,7 +9,7 @@ Le programme reçoit deux paramètres: - Le premier est la `string` - Le deuxième est le séparateur -### Expected output : +### Utilisation : ```console student@ubuntu:~/piscine-go/splitprog$ go build