Browse Source

Merge branch 'master' of github.com:01-edu/public

content-update
Christopher Fremond 5 years ago
parent
commit
0484f9cc79
  1. 18
      docs/pc-requirements.md
  2. 2
      subjects/atoibase.en.md
  3. 2
      subjects/atoibase.fr.md
  4. 24
      subjects/capitalizeprog.en.md
  5. 24
      subjects/capitalizeprog.fr.md
  6. 2
      subjects/collatzcountdown.en.md
  7. 10
      subjects/collatzcountdown.fr.md
  8. 24
      subjects/compareprog.en.md
  9. 24
      subjects/compareprog.fr.md
  10. 3
      subjects/concatparams.en.md
  11. 4
      subjects/displayfile.en.md
  12. 10
      subjects/doop.en.md
  13. 24
      subjects/doop.fr.md
  14. 19
      subjects/firstruneprog.en.md
  15. 19
      subjects/firstruneprog.fr.md
  16. 27
      subjects/ispowerof2.en.md
  17. 27
      subjects/ispowerof2.fr.md
  18. 19
      subjects/lastruneprog.en.md
  19. 19
      subjects/lastruneprog.fr.md
  20. 22
      subjects/nruneprog.en.md
  21. 22
      subjects/nruneprog.fr.md
  22. 31
      subjects/printbits.en.md
  23. 31
      subjects/printbits.fr.md
  24. 10
      subjects/printcombn.fr.md
  25. 4
      subjects/printstr.en.md
  26. 4
      subjects/printstr.fr.md
  27. 17
      subjects/printstrprog.en.md
  28. 17
      subjects/printstrprog.fr.md
  29. 34
      subjects/range.en.md
  30. 32
      subjects/range.fr.md
  31. 8
      subjects/rectangle.en.md
  32. 19
      subjects/rectangle.fr.md
  33. 38
      subjects/reversebits.en.md
  34. 36
      subjects/reversebits.fr.md
  35. 34
      subjects/reverserange.en.md
  36. 34
      subjects/reverserange.fr.md
  37. 18
      subjects/rot14prog.en.md
  38. 18
      subjects/rot14prog.fr.md
  39. 4
      subjects/split.en.md
  40. 6
      subjects/split.fr.md
  41. 24
      subjects/splitprog.en.md
  42. 24
      subjects/splitprog.fr.md
  43. 4
      subjects/splitwhitespaces.en.md
  44. 4
      subjects/splitwhitespaces.fr.md
  45. 2
      subjects/strlen.en.md
  46. 2
      subjects/strlen.fr.md
  47. 19
      subjects/strlenprog.en.md
  48. 19
      subjects/strlenprog.fr.md
  49. 15
      subjects/strrevprog.en.md
  50. 15
      subjects/strrevprog.fr.md
  51. 2
      subjects/to-git-or-not-to-git.en.md

18
docs/pc-requirements.md

@ -0,0 +1,18 @@
# 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.
- It is better to buy the computers without a Windows licence, as it is an unnecessary extra cost.

2
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"))
}
```

2
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"))
}
```

24
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 there is more than one argument the program should print `Too many arguments`.
- If there is no arguments given the program should print a newline ("`\n`").
### Usage :
```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$
```

24
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$
```

2
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 equal to `0` or negative.
### Expected function
```go

10
subjects/collatzcountdown.fr.md

@ -4,7 +4,9 @@
Écrire une fonction, `CollatzCountdown`, qui retournes le nombre d'étapes nécéssaires pour atteindre 1 en utilisant le comptage de collatz.
### FOnction attendue
- Elle doit renvoyer `-1` si `start` est égal à 0 ou négatif.
### Fonction attendue
```go
func CollatzCountdown(start int) int {
@ -33,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$
```

24
subjects/compareprog.en.md

@ -0,0 +1,24 @@
## compareprog
### Instructions
Write a program that behaves like the `Compare` function.
This program prints a number after comparing two `strings` lexicographically.
### Usage :
```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$
```

24
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$
```

3
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 {
}
```

4
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

10
subjects/doop.en.md

@ -23,14 +23,12 @@ The program has to handle the modulo and division operations by 0 as shown on th
```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 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

24
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
```

19
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" | 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$
```

19
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$
```

27
subjects/ispowerof2.en.md

@ -2,14 +2,29 @@
### 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 is more than one or no argument the program should print a newline ("`\n`").
```go
func IsPowerOf2(n uint) bool {
- Error cases have to be handled.
}
### Usage :
```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$
```

27
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 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$
```

19
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" | 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$
```

19
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$
```

22
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 | 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$
```

22
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$
```

31
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) {
}
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 is not a number the program 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$
```
### Usage
Example of output:
If 2 is passed to the function `PrintBits`, it will print "00000010".

31
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".

10
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$
```

4
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
student@ubuntu:~/piscine-go/test$ ./test | cat -e
Hello World!%
student@ubuntu:~/piscine-go/test$
```

4
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$
```

17
subjects/printstrprog.en.md

@ -0,0 +1,17 @@
## printstrprog
### Instructions
- 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!" | 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$
```

17
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$
```

34
subjects/range.en.md

@ -2,23 +2,29 @@
### Instructions
Write the function `Range` which must:
Write a 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 begins at the first argument and end at the second argument (Including the values of thoses arguments !).
```go
func Range(start, end int) []int {
- That prints the array.
}
```
Errors should be handled.
If the number of arguments is different from 2 the program prints a newline ("`\n`").
### Usage
### Expected output :
- 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.
```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$
```

32
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$
```

8
subjects/rectangle.en.md

@ -11,11 +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

19
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 {

38
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.
### Expected function
```go
func ReverseBits(octet byte) byte {
}
```
Example:
1 byte
---
```
00100110
||
\/
01100100
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
```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$
```

36
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$
```

34
subjects/reverserange.en.md

@ -2,23 +2,31 @@
### Instructions
Write the function `ReverseRange` which must:
Write a 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 values of thoses arguments !).
```go
func ReverseRange(start, end int) []int {
- That prints the array.
}
```
Errors should be handled.
If the number of arguments is different from 2 the program prints a newline ("`\n`").
### Usage :
- 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.
```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$
```

34
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 au deuxième argument et qui finissent au premier (En incluant les valeurs des deux arguments !)
```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$
```

18
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" | cat -e
Vszzc Vck ofs Mci$
student@ubuntu:~/rot14prog$ ./rot14prog Hello How are You
student@ubuntu:~/rot14prog$ ./rot14prog
student@ubuntu:~/rot14prog$
```

18
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$
```

4
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 :

6
subjects/split.fr.md

@ -4,12 +4,13 @@
É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
```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 :

24
subjects/splitprog.en.md

@ -0,0 +1,24 @@
## splitprog
### Instructions
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 first is the `string`
- The second is the separator
### Usage :
```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$
```

24
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
### Utilisation :
```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$
```

4
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 :

4
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 :

2
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

2
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

19
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 or no arguments it must not print anything.
### Expected output :
```console
student@ubuntu:~/piscine-go/strlenprog$ go build
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"
student@ubuntu:~/piscine-go/strlenprog$
```

19
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" | cat -e
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$
```

15
subjects/strrevprog.en.md

@ -0,0 +1,15 @@
## strrevprog
### Instructions
- 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!" | cat -e
!dlroW olleH$
student@ubuntu:~/piscine-go/strrevprog$ ./strrevprog
student@ubuntu:~/piscine-go/strrevprog$
```

15
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$
```

2
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

Loading…
Cancel
Save