Browse Source

Exam3et4 (#253)

* Corrected spelling mistakes.
* Deleted listpushpara.
content-update
Christopher Fremond 5 years ago committed by MarieMalarme
parent
commit
0bebacfc1b
  1. 6
      subjects/addprimesum.en.md
  2. 6
      subjects/addprimesum.fr.md
  3. 2
      subjects/alphamirror.en.md
  4. 2
      subjects/alphamirror.fr.md
  5. 4
      subjects/atoi.en.md
  6. 4
      subjects/atoi.fr.md
  7. 12
      subjects/atoibase.fr.md
  8. 2
      subjects/basicatoi2.fr.md
  9. 19
      subjects/brackets.en.md
  10. 20
      subjects/brackets.fr.md
  11. 16
      subjects/brainfuck.en.md
  12. 32
      subjects/brainfuck.fr.md
  13. 2
      subjects/capitalize.fr.md
  14. 10
      subjects/createelem.fr.md
  15. 4
      subjects/doop.en.md
  16. 8
      subjects/expandstr.en.md
  17. 12
      subjects/expandstr.fr.md
  18. 8
      subjects/fprime.en.md
  19. 10
      subjects/fprime.fr.md
  20. 13
      subjects/gcd.en.md
  21. 12
      subjects/gcd.fr.md
  22. 12
      subjects/hiddenp.en.md
  23. 13
      subjects/hiddenp.fr.md
  24. 2
      subjects/inter.en.md
  25. 2
      subjects/inter.fr.md
  26. 4
      subjects/ispowerof2.en.md
  27. 6
      subjects/ispowerof2.fr.md
  28. 6
      subjects/itoa.fr.md
  29. 8
      subjects/itoabase.en.md
  30. 16
      subjects/itoabase.fr.md
  31. 2
      subjects/lastword.en.md
  32. 4
      subjects/lastword.fr.md
  33. 20
      subjects/listpushpara.fr.md
  34. 2
      subjects/listremoveif.en.md
  35. 18
      subjects/options.en.md
  36. 18
      subjects/options.fr.md
  37. 6
      subjects/paramcount.en.md
  38. 7
      subjects/paramcount.fr.md
  39. 2
      subjects/printbits.en.md
  40. 8
      subjects/printbits.fr.md
  41. 6
      subjects/printhex.en.md
  42. 6
      subjects/printhex.fr.md
  43. 10
      subjects/printmemory.fr.md
  44. 10
      subjects/printnbrbase.fr.md
  45. 6
      subjects/range.en.md
  46. 20
      subjects/range.fr.md
  47. 2
      subjects/repeatalpha.en.md
  48. 6
      subjects/repeatalpha.fr.md
  49. 4
      subjects/reversebits.en.md
  50. 2
      subjects/reversebits.fr.md
  51. 6
      subjects/reverserange.en.md
  52. 20
      subjects/reverserange.fr.md
  53. 8
      subjects/reversestrcap.en.md
  54. 13
      subjects/reversestrcap.fr.md
  55. 8
      subjects/revwstr.en.md
  56. 10
      subjects/revwstr.fr.md
  57. 8
      subjects/rostring.en.md
  58. 15
      subjects/rostring.fr.md
  59. 2
      subjects/rot13.en.md
  60. 4
      subjects/rot13.fr.md
  61. 2
      subjects/rot14.en.md
  62. 4
      subjects/rot14.fr.md
  63. 22
      subjects/rpncalc.en.md
  64. 37
      subjects/rpncalc.fr.md
  65. 2
      subjects/searchreplace.en.md
  66. 18
      subjects/sortlist.fr.md
  67. 4
      subjects/split.en.md
  68. 2
      subjects/split.fr.md
  69. 2
      subjects/switchcase.en.md
  70. 2
      subjects/switchcase.fr.md
  71. 4
      subjects/tabmult.en.md
  72. 36
      subjects/tabmult.fr.md
  73. 2
      subjects/union.en.md
  74. 2
      subjects/union.fr.md
  75. 12
      subjects/wdmatch.en.md
  76. 12
      subjects/wdmatch.fr.md

6
subjects/addprimesum.en.md

@ -2,11 +2,11 @@
### Instructions
Write a program that takes a positive integer as argument and displays the sum of all prime numbers inferior or equal to it followed by a newline.
Write a program that takes a positive integer as argument and displays the sum of all prime numbers inferior or equal to it followed by a newline(`'\n`').
- If the number of arguments is not 1, or if the argument is not a positive number, the program displays 0 followed by a newline.
- If the number of arguments is different from 1, or if the argument is not a positive number, the program displays `0` followed by a newline.
Examples of outputs :
### Usage
```console
student@ubuntu:~/piscine/test$ go build

6
subjects/addprimesum.fr.md

@ -2,11 +2,11 @@
### Instructions
Write a program that takes a positive integer as argument and displays the sum of all prime numbers inferior or equal to it followed by a newline.
Écrire un programme qui prend un entier positif comme argument et qui affiche la somme de tous les nombres premiers inférieurs ou égaux à celui-ci, suivie d'un newline(`'\n`').
- If the number of arguments is not 1, or if the argument is not a positive number, the program displays 0 followed by a newline.
- Si le nombre d'arguments est différent de 1, ou si l'argument n'est pas un nombre positif, le programme affiche `0` suivi d'un newline.
Examples of outputs :
### Utilisation
```console
student@ubuntu:~/piscine/test$ go build

2
subjects/alphamirror.en.md

@ -13,7 +13,7 @@ The case of the letter stays the same, for example :
The final result will be followed by a newline(`'\n'`).
If the number of arguments is not 1, the program displays only a newline(`'\n'`).
If the number of arguments is different from 1, the program displays only a newline(`'\n'`).
### Usage

2
subjects/alphamirror.fr.md

@ -11,7 +11,7 @@ Les majuscules restent des majuscules, de même pour le minuscules, par exemple
Le résultat final sera suivi d'un newline(`'\n'`).
Si le nombre d'arguments n'est pas 1, le programme affiche seulement un newline(`'\n'`).
Si le nombre d'arguments est différent de 1, le programme affiche seulement un newline(`'\n'`).
### Utilisation

4
subjects/atoi.en.md

@ -4,13 +4,13 @@
- Write a [function](TODO-LINK) that simulates the behaviour of the `Atoi` function in Go. `Atoi` transforms a number represented as a `string` in a number represented as an `int`.
- Atoi returns `0` if the `string` is not considered as a valid number. For this exercise **non-valid `string` chains will be tested**. Some will contain non-digits characters.
- `Atoi` returns `0` if the `string` is not considered as a valid number. For this exercise **non-valid `string` chains will be tested**. Some will contain non-digits characters.
- For this exercise the handling of the signs + or - **does have** to be taken into account.
- This function will **only** have to return the `int` `nbr`. For this exercise the `error` return of atoi is not required.
### Format required
### Expected function
```go
func Atoi(s string) int {

4
subjects/atoi.fr.md

@ -2,9 +2,9 @@
### Instructions
- Écrire une fonction qui reproduit le comportement de la fonction atoi en Go. Atoi transforme un nombre représenté en `string` (chaîne de caractères) en `int` (entier).
- Écrire une fonction qui reproduit le comportement de la fonction `Atoi` en Go. `Atoi` transforme un nombre représenté en `string` (chaîne de caractères) en `int` (entier).
- Atoi retourne `0` si la `string` n'est pas considéré un nombre valide. Pour cet exercice des **`string` non valides seront testées!**. Certaines contiendront d'autres charactères que des chiffres.
- `Atoi` retourne `0` si la `string` n'est pas considéré un nombre valide. Pour cet exercice des **`string` non valides seront testées!**. Certaines contiendront d'autres caractères que des chiffres.
- Pour cet exercice la gestion des signes + ou - **doit être** prise en compte.

12
subjects/atoibase.fr.md

@ -2,15 +2,15 @@
### Instructions
Écrire une fonction qui prend un nombre `string` et sa base `string` en paramètres et retournes sa convertion en `int`.
Écrire une fonction qui prend un nombre `string` et sa base `string` en paramètres et retourne sa conversion en `int`.
Si la base n'est pas valide elle retournes `0`:
Si la base n'est pas valide elle retourne `0`:
Régles de validité d'une base :
Règles de validité d'une base :
- Une base doit contenir au moins 2 charactères.
- Chaque charactère d'une base doit être unique.
- Une base ne doit pas contenir les charactères `+` ou `-`.
- Une base doit contenir au moins 2 caractères.
- Chaque caractère d'une base doit être unique.
- Une base ne doit pas contenir les caractères `+` ou `-`.
Seuls des nombres en `string` valides seront testés.

2
subjects/basicatoi2.fr.md

@ -4,7 +4,7 @@
- Écrire une fonction qui reproduit le comportement de la fonction atoi en Go. Atoi transforme un nombre représenté en `string` (chaîne de caractères) en `int` (entier).
- Atoi retourne `0` si la `string` n'est pas considéré un nombre valide. Pour cet exercice des **`string` non valides seront testées!**. Certaines contiendront d'autres charactères que des chiffres.
- Atoi retourne `0` si la `string` n'est pas considérée comme un nombre valide. Pour cet exercice des **`string` non valides seront testées!**. Certaines contiendront d'autres caractères que des chiffres.
- Pour cet exercice la gestion des signes + ou - ne doit pas être prise en compte.

19
subjects/brackets.en.md

@ -2,23 +2,20 @@
### Instructions
Write a program that takes an undefined number of strings in arguments. For each
argument, the program prints on the standard output "OK" followed by a newline
if the expression is correctly bracketed, otherwise it prints "Error" followed by
Write a program that takes an undefined number of `strings` in arguments. For each
argument, if the expression is correctly bracketed, the program prints on the standard output `OK` followed by a newline(`'\n'`), otherwise it prints "Error" followed by
a newline.
Symbols considered as `brackets` are brackets `(` and `)`, square brackets `[`
and `]`and braces `{` and `}`. Every other symbols are simply ignored.
Symbols considered as `brackets` are parentheses `(` and `)`, square brackets `[`
and `]` and curly braces `{` and `}`. Every other symbols are simply ignored.
An opening bracket must always be closed by the good closing bracket in the
correct order. A string which do not contains any bracket is considered as a
correctly bracketed string.
If there is no arguments, the program must print only a newline.
correct order. A `string` which does not contain any bracket is considered as a
correctly bracketed `string`.
If there is no argument, the program must print only a newline.
Examples of outputs :
### Usage
```console
student@ubuntu:~/student/brackets$ go build

20
subjects/brackets.fr.md

@ -2,23 +2,17 @@
### Instructions
Write a program that takes an undefined number of strings in arguments. For each
argument, the program prints on the standard output "OK" followed by a newline
if the expression is correctly bracketed, otherwise it prints "Error" followed by
a newline.
Écrire un programme qui prend un nombre indéfini de `strings` en arguments. Pour chaque
argument, si l'expression est correctement "entre parenthèses" (bracketed), le programme affiche sur la sortie standard `OK` suivi d'un newline(`'\n'`), autrement il affiche `Error` suivi d'un newline.
Les symboles considérés comme des `parenthèses` sont les parenthèses `(` et `)`, les crochets `[`
et `]` et les accolades `{` et `}`. Tout autre symbole est simplement ignoré.
Symbols considered as `brackets` are brackets `(` and `)`, square brackets `[`
and `]`and braces `{` and `}`. Every other symbols are simply ignored.
Une parenthèse ouvrante doit toujours être fermée par la parenthèse correspondante dans l'ordre correct. Une `string` qui ne contient aucune parenthèse est considérée comme une `string` correctement "entre parenthèses".
An opening bracket must always be closed by the good closing bracket in the
correct order. A string which do not contains any bracket is considered as a
correctly bracketed string.
Si il n'y a pas d'argument, le programme affiche seulement un newline.
If there is no arguments, the program must print only a newline.
Examples of outputs :
### Utilisation
```console
student@ubuntu:~/student/brackets$ go build

16
subjects/brainfuck.en.md

@ -2,12 +2,12 @@
### Instructions
Write a Brainfuck interpreter program.
Write a `Brainfuck` interpreter program.
The source code will be given as first parameter.
The code will always be valid, with no more than 4096 operations.
Brainfuck is a minimalist language. It consists of an array of bytes
(in our case, let's say 2048 bytes) initialized to zero,
and a pointer to its first byte.
The code will always be valid, with less than 4096 operations.
`Brainfuck` is a minimalist language. It consists of an array of bytes
(in this exercice 2048 bytes) all initialized with zero,
and with a pointer to its first byte.
Every operator consists of a single character :
@ -16,12 +16,12 @@ Every operator consists of a single character :
- '+' increment the pointed byte ;
- '-' decrement the pointed byte ;
- '.' print the pointed byte on standard output ;
- '[' go to the matching ']' if the pointed byte is 0 (while start) ;
- ']' go to the matching '[' if the pointed byte is not 0 (while end).
- '[' go to the matching ']' if the pointed byte is 0 (loop start) ;
- ']' go to the matching '[' if the pointed byte is not 0 (loop end).
Any other character is a comment.
Examples of outputs :
### Usage
```console
student@ubuntu:~/student/brainfuck$ go build

32
subjects/brainfuck.fr.md

@ -2,26 +2,26 @@
### Instructions
Write a Brainfuck interpreter program.
The source code will be given as first parameter.
The code will always be valid, with no more than 4096 operations.
Brainfuck is a minimalist language. It consists of an array of bytes
(in our case, let's say 2048 bytes) initialized to zero,
and a pointer to its first byte.
Écrire un program interpréteur du `Brainfuck`.
Le code source sera donné en premier paramètre.
Le code sera toujours valide, avec moins de 4096 operations.
Le `Brainfuck` est un langage minimaliste. Il consiste en un slice de bytes (octet)
(dans cet exercise 2048 bytes) tous initialisés à zéro,
et avec un pointeur sur le premier byte.
Every operator consists of a single character :
Chaque opérateur consiste en un seul caractère :
- '>' increment the pointer ;
- '<' decrement the pointer ;
- '+' increment the pointed byte ;
- '-' decrement the pointed byte ;
- '.' print the pointed byte on standard output ;
- '[' go to the matching ']' if the pointed byte is 0 (while start) ;
- ']' go to the matching '[' if the pointed byte is not 0 (while end).
- '>' incrémente le pointeur ;
- '<' décrémente le pointeur ;
- '+' incrémente le byte pointé ;
- '-' décrémente le byte pointé ;
- '.' affiche le byte pointé sur la sortie standard ;
- '[' se rend à son ']' correspondant si le byte pointé est 0 (début de la boucle) ;
- ']' se rend à son '[' correspondant si le byte pointé n'est pas 0 (fin de la boucle).
Any other character is a comment.
Tout autre caractère est un commentaire.
Examples of outputs :
### Utilisation
```console
student@ubuntu:~/student/brainfuck$ go build

2
subjects/capitalize.fr.md

@ -2,7 +2,7 @@
### Instructions
Écrire une fonction qui met en majuscule la premiere lettre de chaque mot et en minuscule les autres lettres du reste du mot d'une `string`.
Écrire une fonction 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**.

10
subjects/createelem.fr.md

@ -2,9 +2,9 @@
### Instructions
Write a function `CreateElem` that creates a new element of type`Node`.
Écrire une fonction `CreateElem` qui crée un nouvel élément de type `Node`.
### Expected function and structure
### Fonction attendue et structure
```go
type Node struct {
@ -16,9 +16,9 @@ func CreateElem(n *Node, value int) {
}
```
### Usage
### Utilisation
Here is a possible [program](TODO-LINK) to test your function :
Voici un éventuel [programme](TODO-LINK) pour tester votre fonction :
```go
package main
@ -35,7 +35,7 @@ func main() {
}
```
And its output :
Et son résultat :
```console
student@ubuntu:~/piscine/test$ go build

4
subjects/doop.en.md

@ -14,11 +14,11 @@ In case of an invalid operator the programs prints `0`.
In case of an invalid number of arguments the program prints nothing.
The program has to handle the modulo and division operations by 0 as shown on the output examples below.
The program has to handle the modulo and division operations by 0 as shown on the output examples below.
`fmt.Print` is authorized.
Examples of outputs :
### Usage
```console
student@ubuntu:~/piscine/test$ go build doop.go

8
subjects/expandstr.en.md

@ -2,17 +2,17 @@
### Instructions
Write a program that takes a string and displays it with exactly three spaces
Write a program that takes a `string` and displays it with exactly three spaces
between each word, with no spaces or tabs at either the beginning nor the end.
The string will be followed by a newline.
The `string` will be followed by a newline(`'\n'`).
A word is a sequence of alphanumerical characters.
If the number of parameters is not 1, or if there are no words, the program displays
If the number of parameters is not 1, or if there are no word, the program displays
a newline.
Examples of outputs :
### Usage
```console
student@ubuntu:~/student/expandstr$ go build

12
subjects/expandstr.fr.md

@ -2,17 +2,15 @@
### Instructions
Write a program that takes a string and displays it with exactly three spaces
between each word, with no spaces or tabs at either the beginning nor the end.
Écrire un programme qui prend une `string` et qui l'affiche avec exactement 3 espaces entre chaque mot, sans espace ou tabulation ni au début ni à la fin.
The string will be followed by a newline.
La `string` sera suivie d'un newline(`'\n'`).
A word is a sequence of alphanumerical characters.
Un mot est une suite de caractères alphanumériques.
If the number of parameters is not 1, or if there are no words, the program displays
a newline.
Si le nombre de paramètres n'est pas 1, ou si il n'y a pas de mot, le programme affiche un newline.
Examples of outputs :
### Utilisation
```console
student@ubuntu:~/student/expandstr$ go build

8
subjects/fprime.en.md

@ -2,15 +2,15 @@
### Instructions
Write a program that takes a positive `int` and displays its prime factors on the standard output, followed by a newline.
Write a program that takes a positive `int` and displays its prime factors, followed by a newline(`'\n'`).
- Factors must be displayed in ascending order and separated by `*`, so that the expression in the output gives the right result.
- Factors must be displayed in ascending order and separated by `*`.
- If the number of parameters is not 1, the program displays a newline.
- If the number of parameters is different from 1, the program displays a newline.
- The input, when there is one, will always be valid.
Example of output :
### Usage
```console
student@ubuntu:~/piscine/test$ go build

10
subjects/fprime.fr.md

@ -2,15 +2,15 @@
### Instructions
Write a program that takes a positive `int` and displays its prime factors on the standard output, followed by a newline.
Écrire un programme qui prend un `int` positif et qui affiche ses facteurs premiers sur la sortie standard, suivi d'un newline(`'\n'`).
- Factors must be displayed in ascending order and separated by `*`, so that the expression in the output gives the right result.
- Les facteurs doivent être affichés en ordre croissant et séparés par `*`.
- If the number of parameters is not 1, the program displays a newline.
- Si le nombre de paramètres est différent de 1, le programme affiche un newline.
- The input, when there is one, will always be valid.
- L'input (l'entrée), quand il y en a un, sera toujours valide.
Example of output :
### Utilisation
```console
student@ubuntu:~/piscine/test$ go build

13
subjects/gcd.en.md

@ -2,17 +2,16 @@
### Instructions
Write a program that takes two strings representing two strictly positive
integers that fit in an int.
Write a program that takes two `strings` representing two strictly positive
integers that fit in an `int`.
Display their greatest common divisor followed by a newline (It is always a
strictly positive integer).
The program displays their greatest common divisor followed by a newline('`\n`').
If the number of parameters is not 2, display a newline.
If the number of parameters is different from 2, the program displays a newline.
All arguments tested will be valid positive `int` values.
All arguments tested will be positive `int` values.
Example of output :
### Usage
```console
student@ubuntu:~/student/gcd$ go build

12
subjects/gcd.fr.md

@ -2,17 +2,15 @@
### Instructions
Write a program that takes two strings representing two strictly positive
integers that fit in an int.
Écrire un programme qui prend deux `strings` représentant deux entiers strictement positifs qui rentrent dans un `int`.
Display their greatest common divisor followed by a newline (It is always a
strictly positive integer).
Afficher leur plus grand diviseur commun suivi d'un newline('`\n`').
If the number of parameters is not 2, display a newline.
Si le nombre de paramètres est différent de 2, le programme affiche un newline.
All arguments tested will be valid positive `int` values.
Tous les arguments testés seront des `int` positifs.
Example of output :
### Utilisation
```console
student@ubuntu:~/student/gcd$ go build

12
subjects/hiddenp.en.md

@ -2,17 +2,17 @@
### Instructions
Write a program named hiddenp that takes two strings and that, if the first string is hidden in the second one, displays 1
followed by a newline, otherwise it displays 0 followed by a newline.
Write a program named `hiddenp` that takes two `strings` and that, if the first `string` is hidden in the second one, displays `1`
followed by a newline(`'\n'`), otherwise it displays `0` followed by a newline.
Let s1 and s2 be strings. It is considered that s1 is hidden in s2 if it is possible to
Let s1 and s2 be `strings`. It is considered that s1 is hidden in s2 if it is possible to
find each character from s1 in s2, **in the same order as they appear in s1.**
If s1 is an empty string it is considered hidden in any string.
If s1 is an empty `string` it is considered hidden in any `string`.
If the number of parameters is not 2, the program displays a newline.
If the number of parameters is different from 2, the program displays a newline.
Example of output :
### Usage
```console
student@ubuntu:~/student/hiddenp$ go build

13
subjects/hiddenp.fr.md

@ -2,17 +2,16 @@
### Instructions
Write a program named hiddenp that takes two strings and that, if the first string is hidden in the second one, displays 1
followed by a newline, otherwise it displays 0 followed by a newline.
Écrire un programme nommé `hiddenp` qui prend deux `strings` et qui, si la première `string` est cachée dans la deuxième, affiche `1`
suivi d'un newline(`'\n'`), autrement il affiche `0` suivi d'un newline.
Let s1 and s2 be strings. It is considered that s1 is hidden in s2 if it is possible to
find each character from s1 in s2, **in the same order as they appear in s1.**
Considérons s1 et s2 comme étant des `strings`. Il est considéré que s1 est cachée dans s2 si il est possbile de trouver chaque caractère de s1 dans s2, **dans le même ordre d'apparence que s1.**
If s1 is an empty string it is considered hidden in any string.
Si s1 est une `string` vide elle est considérée cachée dans n'importe quelle `string`.
If the number of parameters is not 2, the program displays a newline.
Si le nombre de paramètres est différent de 2, le programme affiche un newline.
Example of output :
### Utilisation
```console
student@ubuntu:~/student/hiddenp$ go build

2
subjects/inter.en.md

@ -6,7 +6,7 @@ Write a program that takes two `strings` and displays, without doubles, the char
- The display will be followed by a newline(`'\n'`).
- If the number of arguments is not 2, the program displays a newline(`'\n'`).
- If the number of arguments is different from 2, the program displays a newline(`'\n'`).
### Usage

2
subjects/inter.fr.md

@ -6,7 +6,7 @@
- L'affichage sera suivi d'un newline(`'\n'`).
- Si le nombre d'arguments n'est pas 2, le programme affiche un newline(`'\n'`).
- Si le nombre d'arguments est différent de 2, le programme affiche un newline(`'\n'`).
### Utilisation

4
subjects/ispowerof2.en.md

@ -4,9 +4,9 @@
Write a function 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 function returns `true` if the given number is a power of 2, otherwise it returns `false`.
## Expected function
### Expected function
```go
func IsPowerOf2(n uint) bool {

6
subjects/ispowerof2.fr.md

@ -2,11 +2,11 @@
### Instructions
Write a function that determines if a given number is a power of 2.
Écrire une fonction qui détermine si un nombre donné est une puissance de 2.
This function returns true if the given number is a power of 2, otherwise it returns false.
Cette fonction retourne `true` si le nombre donné est une puissance de 2, autrement elle retourne `false`.
## Expected function
### Fonction attendue
```go
func IsPowerOf2(n uint) bool {

6
subjects/itoa.fr.md

@ -2,11 +2,11 @@
### Instructions
- Write a function that simulates the behaviour of the `Itoa` function in Go. `Itoa` transforms a number represented as an`int` in a number represented as a `string`.
- Écrire une fonction qui reproduit le comportement de la fonction `Itoa` en Go. `Itoa` transforme un nombre représenté en `int` (entier) en `string` (chaîne de caractères).
- For this exercise the handling of the signs + or - **does have** to be taken into account.
- Pour cet exercice la gestion des signes + ou - **doit être** prise en compte.
## Expected function
## Fonction attendue
```go
func Itoa(n int) string {

8
subjects/itoabase.en.md

@ -4,15 +4,15 @@
Write a function that:
- converts an integer value to a string using the specified base in the argument
- and then returns this string
- converts an `int` value to a `string` using the specified base in the argument
- and that returns this `string`
The base is expressed as an integer, from 2 to 16. The characters comprising
The base is expressed as an `int`, from 2 to 16. The characters comprising
the base are the digits from 0 to 9, followed by uppercase letters from A to F.
For example, the base `4` would be the equivalent of "0123" and the base `16` would be the equivalent of "0123456789ABCDEF".
If the value is negative, the resulting string has to be preceded with a
If the value is negative, the resulting `string` has to be preceded with a
minus sign `-`.
### Expected function

16
subjects/itoabase.fr.md

@ -2,20 +2,18 @@
### Instructions
Write a function that:
Écrire une fonction qui:
- converts an integer value to a string using the specified base in the argument
- and then returns this string
- convertit une valeur `int` en `string` en utilisant la base spécifiée en argument
- et qui retourne cette `string`
The base is expressed as an integer, from 2 to 16. The characters comprising
the base are the digits from 0 to 9, followed by uppercase letters from A to F.
Cette base est exprimée comme un `int`, de 2 à 16. Les caractères compris dans la base sont les chiffres de 0 à 9, suivis des lettres majuscules de A à F.
For example, the base `4` would be the equivalent of "0123" and the base `16` would be the equivalent of "0123456789ABCDEF".
Par exemple, la base `4` sera équivalente à "0123" et la base `16` sera équivalente à "0123456789ABCDEF".
If the value is negative, the resulting string has to be preceded with a
minus sign `-`.
Si la valeur est négative, la `string` résultante doit être précédée d'un signe moins `-`.
### Expected function
### Fonction attendue
```go
func ItoaBase(value, base int) string {

2
subjects/lastword.en.md

@ -8,7 +8,7 @@ Write a program that takes a `string` and displays its last word, followed by a
- The output will be followed by a newline(`'\n'`).
- If the number of parameters is not 1, or if there are no words, the program displays a newline(`'\n'`).
- If the number of parameters is different from 1, or if there are no word, the program displays a newline(`'\n'`).
### Usage

4
subjects/lastword.fr.md

@ -4,11 +4,11 @@
Écrire un programme qui prend une `string` et qui affiche son dernier mot, suivi d'un newline(`'\n'`).
- Un mot est une section de `string` délimité par des espace ou par le début/fin d'une `string`.
- Un mot est une section de `string` délimitée par des espaces ou par le début/fin d'une `string`.
- L'output sera suivi d'un newline(`'\n'`).
- Si le nombre de paramètres n'est pas 1, ou si il n'y a pas de mots, le programme affiche un newline(`'\n'`).
- Si le nombre de paramètres est différent de 1, ou si il n'y a pas de mot, le programme affiche un newline(`'\n'`).
### Utilisation

20
subjects/listpushpara.fr.md

@ -1,20 +0,0 @@
## listpushpara
### Instructions
Write a program that creates a new linked list and includes each command-line argument in to the list.
- The first argument should be at the end of the list
And its output :
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./listpushparams choumi is the best cat
cat
best
the
is
choumi
student@ubuntu:~/piscine/test$
```

2
subjects/listremoveif.en.md

@ -2,7 +2,7 @@
### Instructions
Write a function `ListRemoveIf` that removes all elements that are equal to the `data_ref` introduced in the argument of the function.
Write a function `ListRemoveIf` that removes all elements that are equal to the `data_ref` in the argument of the function.
### Expected function and structure

18
subjects/options.en.md

@ -2,21 +2,21 @@
## Instructions
Write a program that takes an undefined number of arguments which could be considered as options and writes on the standard output a representation of those options as groups of bytes followed by a newline.
Write a program that takes an undefined number of arguments which could be considered as `options` and writes on the standard output a representation of those `options` as groups of `bytes` followed by a newline(`'\n'`).
- An option is an argument that begins by a `-` and have multiple characters which could be :
- abcdefghijklmnopqrstuvwxyz
- An `option` is an argument that begins with a `-` and that can have multiple characters which could be :
-abcdefghijklmnopqrstuvwxyz
- All options are stocked in a single int and each options represents a bit of that int, and should be stocked like this :
- All `options` are stocked in a single `int` and each `options` represents a bit of that `int`, and should be stocked like this :
- 00000000 00000000 00000000 00000000
- ******zy xwvutsrq ponmlkji hgfedcba
- 00000000 00000000 00000000 00000000
- ******zy xwvutsrq ponmlkji hgfedcba
- Launching the program without arguments or with the `-h` flag activated must print all the valid options on the standard output, as shown on one of the following examples.
- Launching the program without arguments or with the `-h` flag activated must print all the valid `options` on the standard output, as shown on one of the following examples.
- A wrong option must print "Invalid Option" followed by a newline.
- A wrong `option` must print `Invalid Option` followed by a newline.
## Expected output
## Usage
```console
student@ubuntu:~/piscine/test$ go build

18
subjects/options.fr.md

@ -2,21 +2,21 @@
## Instructions
Write a program that takes an undefined number of arguments which could be considered as options and writes on the standard output a representation of those options as groups of bytes followed by a newline.
Écrire un programme qui prend un nombre indéfini d'arguments qui peuvent être considérés comme des `options` et qui affiche sur la sortie standard une représentation de ces `options` comme groupes de `bytes`(octets) suivi d'un newline(`'\n'`).
- An option is an argument that begins by a `-` and have multiple characters which could be :
- abcdefghijklmnopqrstuvwxyz
- Une `option` est un argument qui commence avec un `-` et qui peux avoir de multiples caractères qui peuvent être :
-abcdefghijklmnopqrstuvwxyz
- All options are stocked in a single int and each options represents a bit of that int, and should be stocked like this :
- Toutes les `options` sont stockées dans un seul `int` et chaque `option` représente un bit de cet `int`, et doit être stocké comme ci-dessous :
- 00000000 00000000 00000000 00000000
- ******zy xwvutsrq ponmlkji hgfedcba
- 00000000 00000000 00000000 00000000
- ******zy xwvutsrq ponmlkji hgfedcba
- Launching the program without arguments or with the `-h` flag activated must print all the valid options on the standard output, as shown on one of the following examples.
- L'éxécution du programme sans argument ou avec l'option `-h` activée doit afficher toutes les `options` valides sur la sortie standard, comme montré dans un des exemples ci-dessous.
- A wrong option must print "Invalid Option" followed by a newline.
- Une mauvaise `option` doit afficher `Invalid Option` suivi d'un newline.
## Expected output
## Utilisation
```console
student@ubuntu:~/piscine/test$ go build

6
subjects/paramcount.en.md

@ -3,11 +3,11 @@
### Instructions
Write a program that displays the number of arguments passed to it. This number will be followed by
a newline.
a newline(`'\n'`).
If there are no arguments, just display a 0 followed by a newline.
If there is no argument, the program displays `0` followed by a newline.
Examples of outputs :
### Usage
```console
student@ubuntu:~/student/paramcount$ go build

7
subjects/paramcount.fr.md

@ -2,12 +2,11 @@
### Instructions
Write a program that displays the number of arguments passed to it. This number will be followed by
a newline.
Écrire un programme qui affiche le nombre d'arguments passés à ce programme. Ce nombre sera suivi d'un newline(`'\n'`).
If there are no arguments, just display a 0 followed by a newline.
Si il n'y a pas d'argument, le programme affiche `0` suivi d'un newline.
Examples of outputs :
### Utilisation
```console
student@ubuntu:~/student/paramcount$ go build

2
subjects/printbits.en.md

@ -16,4 +16,4 @@ func PrintBits(octe byte) {
Example of output:
If 2 is passed to the function PrintBits, it will print "00000010".
If 2 is passed to the function `PrintBits`, it will print "00000010".

8
subjects/printbits.fr.md

@ -2,9 +2,9 @@
### Instructions
Write a function that takes a byte, and prints it in binary value **without a newline at the end**.
Écrire une fonction qui prend un `byte`, et qui l'affiche en valeur binaire **sans newline à la fin**.
### Expected function
### Fonction attendue
```go
func PrintBits(octe byte) {
@ -14,6 +14,6 @@ func PrintBits(octe byte) {
### Usage
Example of output:
Exemple d'output:
If 2 is passed to the function PrintBits, it will print "00000010".
Si 2 est passé à la fonction `PrintBits`, elle affichera "00000010".

6
subjects/printhex.en.md

@ -2,11 +2,11 @@
### Instructions
Write a program that takes a positive (or zero) number expressed in base 10, and displays it in base 16 ( with lowercase letters) followed by a newline.
Write a program that takes a positive (or zero) number expressed in base 10, and displays it in base 16 (with lowercase letters) followed by a newline(`'\n'`).
- If the number of parameters is not 1, the program displays a newline.
- If the number of parameters is different from 1, the program displays a newline.
Examples of outputs :
### Usage
```console
student@ubuntu:~/piscine/test$ go build

6
subjects/printhex.fr.md

@ -2,11 +2,11 @@
### Instructions
Write a program that takes a positive (or zero) number expressed in base 10, and displays it in base 16 ( with lowercase letters) followed by a newline.
Écrire un programme qui prend un nombre positif (ou zéro) écrit en base 10, et qui l'affiche en base 16 (avec les lettres en minuscule) suivi d'un newline(`'\n`').
- If the number of parameters is not 1, the program displays a newline.
- Si le nombre de paramètres est différent de 1, le programme affiche un newline.
Examples of outputs :
### Utilisation
```console
student@ubuntu:~/piscine/test$ go build

10
subjects/printmemory.fr.md

@ -2,9 +2,9 @@
### Instructions
Write a function that takes `(arr [10]int)`, and displays the memory as in the example.
Écrire une fonction qui prend `(arr [10]int)`, et qui affiche la mémoire comme dans l'exemple.
### Expected function
### Fonction attendue
```go
func PrintMemory(arr [10]int) {
@ -12,9 +12,9 @@ func PrintMemory(arr [10]int) {
}
```
### Usage
### Utilisation
Here is a possible program to test your function :
Voici un éventuel [programme](TODO-LINK) pour tester votre fonction :
```go
func main() {
@ -23,7 +23,7 @@ func main() {
}
```
And its output :
Et son résultat :
```console
student@ubuntu:~/piscine/test$ go build

10
subjects/printnbrbase.fr.md

@ -6,13 +6,13 @@
Si la base n'est pas valide, la fonction affiche `NV` (Not Valid):
Régles de validité d'une base :
Règles de validité d'une base :
- Une base doit contenir au moins 2 charactères.
- Chaque charactère d'une base doit être unique.
- Une base ne doit pas contenir les charactères `+` ou `-`.
- Une base doit contenir au moins 2 caractères.
- Chaque caractère d'une base doit être unique.
- Une base ne doit pas contenir les caractères `+` ou `-`.
La fonction doit gérer les nombres négatifs. (comme montré sur l'exemple)
La fonction doit gérer les nombres négatifs (comme montré sur l'exemple).
### Fonction attendue

6
subjects/range.en.md

@ -2,11 +2,11 @@
### Instructions
Write the function Range which must:
Write the function `Range` 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` !)
- finally return that array.
- and that returns that array.
### Expected function
@ -16,7 +16,7 @@ func Range(start, end int) []int {
}
```
Examples of outputs :
### Usage
- 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.

20
subjects/range.fr.md

@ -2,13 +2,13 @@
### Instructions
Write the function Range which must:
Écrire la fonction `Range` qui doit:
- allocate (with make()) an array of integers.
- fill it with consecutive values that begin at `start` and end at `end` (Including `start` and `end` !)
- finally return that array.
- 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.
### Expected function
### Fonction attendue
```go
func Range(start, end int) []int {
@ -16,9 +16,9 @@ func Range(start, end int) []int {
}
```
Examples of outputs :
### Utilisation
- 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.
- 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.

2
subjects/repeatalpha.en.md

@ -11,7 +11,7 @@ The result must be followed by a newline(`'\n'`).
The case remains unchanged.
If the number of arguments is not 1, the program displays a newline(`'\n'`).
If the number of arguments is different from 1, the program displays a newline(`'\n'`).
### Usage

6
subjects/repeatalpha.fr.md

@ -6,11 +6,11 @@
Le résultat doit être suivi d'un newline(`'\n'`).
`'a'` deviens `'a'`, `'b'` deviens `'bb'`, `'e'` deviens `'eeeee'`, etc...
`'a'` devient `'a'`, `'b'` devient `'bb'`, `'e'` devient `'eeeee'`, etc...
Si une lettre est majuscule, elle reste majuscule, de même si elle est minuscule.
Si une lettre est en majuscule, elle reste en majuscule, de même si elle est en minuscule.
Si le nombre d'arguments n'est pas 1, le programme affiche un newline(`'\n'`).
Si le nombre d'arguments est différent de 1, le programme affiche un newline(`'\n'`).
### Utilisation

4
subjects/reversebits.en.md

@ -2,8 +2,8 @@
### Instructions
Write a function that takes a `byte`, reverses it `bit` by `bit` (like the
example) and returns the result.
Write a function that takes a `byte`, that reverses it `bit` by `bit` (like the
example) and that returns the result.
### Expected function

2
subjects/reversebits.fr.md

@ -2,7 +2,7 @@
### Instructions
Écrire une fonction qui prend un `byte`, l'inverse `bit` par `bit` (comme sur l'exemple) et retourne le résultat.
É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

6
subjects/reverserange.en.md

@ -2,11 +2,11 @@
### Instructions
Write the function ReverseRange which must:
Write the function `ReverseRange` 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` !)
- finally return that array.
- and that returns that array.
### Expected function
@ -16,7 +16,7 @@ func ReverseRange(start, end int) []int {
}
```
Examples of output :
### 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.

20
subjects/reverserange.fr.md

@ -2,13 +2,13 @@
### Instructions
Write the function ReverseRange which must:
Écrire la fonction `ReverseRange` qui doit:
- allocate (with make()) an array of integers.
- fill it with consecutive values that begin at `end` and end at `start` (Including `start` and `end` !)
- finally return that array.
- 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.
### Expected function
### Fonction attendue
```go
func ReverseRange(start, end int) []int {
@ -16,9 +16,9 @@ func ReverseRange(start, end int) []int {
}
```
Examples of output :
### Utilisation :
- 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.
- 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.

8
subjects/reversestrcap.en.md

@ -2,16 +2,16 @@
### Instructions
Write a program that takes one or more strings and that, **for each argument**:
Write a program that takes one or more `strings` as arguments and that, **for each argument**:
-puts the last character of each word (if it is a letter) in uppercase and the rest
in lowercase
-then it displays the result followed by a `\n`.
-then it displays the result followed by a newline(`'\n'`).
A word is a sequence of alphanumerical characters.
If there are no parameters, the program displays a `\n`.
If there are no parameter, the program displays a newline.
Examples of outputs :
### Usage
```console
student@ubuntu:~/student/reversestrcap$ go build

13
subjects/reversestrcap.fr.md

@ -2,16 +2,15 @@
### Instructions
Write a program that takes one or more strings and that, **for each argument**:
-puts the last character of each word (if it is a letter) in uppercase and the rest
in lowercase
-then it displays the result followed by a `\n`.
Écrire un programme avec une ou plusieurs `strings` comme arguments et qui, **pour chaque argument**:
-place le dernier caractère de chaque mot (si c'est une lettre) en majuscule et le reste en minuscule.
-affiche ensuite le résultat suivi d'un newline(`'\n'`).
A word is a sequence of alphanumerical characters.
Un mot est une suite de caractères alphanumériques.
If there are no parameters, the program displays a `\n`.
Si il n'y a pas de paramètre, le programme affiche un newline.
Examples of outputs :
### Utilisation
```console
student@ubuntu:~/student/reversestrcap$ go build

8
subjects/revwstr.en.md

@ -2,15 +2,15 @@
### Instructions
Write a program that takes a string as a parameter, and prints its words in reverse.
Write a program that takes a `string` as a parameter, and prints its words in reverse.
- A word is a sequence of **alphanumerical** characters.
- If the number of parameters is different from 1, the program will display `\n`.
- If the number of parameters is different from 1, the program will display newline(`'\n'`).
- In the parameters that are going to be tested, there will not be any additional spaces. (meaning that there will not be additionnal spaces at the beginning or at the end of the string, and words will always be separated by exactly one space).
- In the parameters that are going to be tested, there will not be any extra spaces. (meaning that there will not be additionnal spaces at the beginning or at the end of the `string`and that words will always be separated by exactly one space).
Examples of outputs :
### Usage
```console
student@ubuntu:~/piscine/test$ go build

10
subjects/revwstr.fr.md

@ -2,15 +2,15 @@
### Instructions
Write a program that takes a string as a parameter, and prints its words in reverse.
Écrire un programme qui prend une `string` comme paramètre, et affiche ses mots en sens inverse.
- A word is a sequence of **alphanumerical** characters.
- Un mot est une suite de caractères **alphanumériques.**
- If the number of parameters is different from 1, the program will display `\n`.
- Si le nombre de paramètres est différent de 1, le programme affiche un newline(`'\n'`).
- In the parameters that are going to be tested, there will not be any additional spaces. (meaning that there will not be additionnal spaces at the beginning or at the end of the string, and words will always be separated by exactly one space).
- Dans les paramètres qui seront testés, il n'y aura pas d'espaces extra. (ce qui signifie qu'il n'y aura pas d'espaces additionnels, ni au début, ni à la fin de la `string` et que les mots seront toujours séparés par un seul espace).
Examples of outputs :
### Utilisation
```console
student@ubuntu:~/piscine/test$ go build

8
subjects/rostring.en.md

@ -2,7 +2,7 @@
### Instructions
Write a program that takes a string and displays this string after rotating it
Write a program that takes a `string` and displays this `string` after rotating it
one word to the left.
Thus, the first word becomes the last, and others stay in the same order.
@ -11,16 +11,16 @@ A word is a sequence of **alphanumerical** characters.
Words will be separated by only one space in the output.
If the number of arguments is not one, the program displays a newline.
If the number of arguments is different from 1, the program displays a newline.
Examples of outputs :
### Usage
```console
student@ubuntu:~/piscine/rostring$ go build
student@ubuntu:~/piscine/rostring$ ./rostring "abc " | cat -e
abc$
student@ubuntu:~/piscine/rostring$ ./rostring "Let there be light"
there be light There
there be light Let
student@ubuntu:~/piscine/rostring$ ./rostring " AkjhZ zLKIJz , 23y"
zLKIJz , 23y AkjhZ
student@ubuntu:~/piscine/rostring$ ./rostring | cat -e

15
subjects/rostring.fr.md

@ -2,25 +2,24 @@
### Instructions
Write a program that takes a string and displays this string after rotating it
one word to the left.
Écrire un programme qui prend une `string` et affiche cette `string` après avoir déplacé un mot vers la gauche.
Thus, the first word becomes the last, and others stay in the same order.
Le premier mot devient donc le dernier, et le reste des mots reste dans le même ordre.
A word is a sequence of **alphanumerical** characters.
Un mot est une suite de caractères **alphanumériques.**
Words will be separated by only one space in the output.
Les mots devront être séparés par un seul espace dans l'output.
If the number of arguments is not one, the program displays a newline.
Si le nombre d'arguments est différent de 1, le programme affiche un newline.
Examples of outputs :
### Utilisation
```console
student@ubuntu:~/piscine/rostring$ go build
student@ubuntu:~/piscine/rostring$ ./rostring "abc " | cat -e
abc$
student@ubuntu:~/piscine/rostring$ ./rostring "Let there be light"
there be light There
there be light Let
student@ubuntu:~/piscine/rostring$ ./rostring " AkjhZ zLKIJz , 23y"
zLKIJz , 23y AkjhZ
student@ubuntu:~/piscine/rostring$ ./rostring | cat -e

2
subjects/rot13.en.md

@ -9,7 +9,7 @@ letters by the letter 13 spaces ahead in alphabetical order.
- The output will be followed by a newline(`'\n'`).
- If the number of arguments is not 1, the program displays a newline(`'\n'`).
- If the number of arguments is different from 1, the program displays a newline(`'\n'`).
### Usage

4
subjects/rot13.fr.md

@ -2,13 +2,13 @@
### Instructions
Écrire un programme qui prend une `string` et qui l'affiche, en remplaçant chacune de ses lettres par la lettre 13 positions après dans l'ordre alphabétique.
Écrire un programme qui prend une `string` et qui l'affiche, en remplaçant chacune de ses lettres par la lettre qui est 13 positions plus loin dans l'ordre alphabétique.
- 'z' devient 'm' et 'Z' devient 'M'. Les majuscules restent des majuscules, de même pour les minuscules.
- l'output sera suivi d'un newline(`'\n'`).
- Si le nombre d'arguments n'est pas 1, le programme affiche un newline(`'\n'`).
- Si le nombre d'arguments est différent de 1, le programme affiche un newline(`'\n'`).
### Utilisation

2
subjects/rot14.en.md

@ -4,7 +4,7 @@
Write a function `rot14` that returns the `string` within the parameter transformed into a `rot14 string`.
- For more information look what `rot13` stands for.
- There is the need to know what `rot13` stands for.
### Expected function

4
subjects/rot14.fr.md

@ -2,9 +2,9 @@
### Instructions
Écrire une fonction `rot14` qui retournes la `string` en paramètre transformée en `string rot14`.
Écrire une fonction `rot14` qui retourne la `string` en paramètre transformée en `string rot14`.
- Pour plus d'informations chercher ce que `rot13` signifie.
- Il faut savoir ce que `rot13` signifie.
### Fonction attendue

22
subjects/rpncalc.en.md

@ -2,11 +2,11 @@
### Instructions
Write a program that takes a string which contains an equation written in
Reverse Polish notation (RPN) as its first argument, evaluates the equation, and
prints the result on the standard output followed by a newline.
Write a program that takes a `string` which contains an equation written in
`Reverse Polish Notation` (RPN) as its first argument, that evaluates the equation, and that
prints the result on the standard output followed by a newline(`'\n'`).
Reverse Polish Notation is a mathematical notation in which every operator
`Reverse Polish Notation` is a mathematical notation in which every operator
follows all of its operands. In RPN, every operator encountered evaluates the
previous 2 operands, and the result of this operation then becomes the first of
the two operands for the subsequent operator. Operands and operators must be
@ -14,17 +14,17 @@ spaced by at least one space.
The following operators must be implemented : `+`, `-`, `*`, `/`, and `%`.
If the string is not valid or if there is not exactly one argument, `Error` must be printed
If the `string` is not valid or if there is not exactly one argument, `Error` must be printed
on the standard output followed by a newline.
If the string has extra spaces it is still valid.
If the `string` has extra spaces it is still considered valid.
All the given operands must fit in a `int`.
Examples of formulas converted in RPN:
3 + 4 >> 3 4 +
((1 * 2) * 3) - 4 >> 1 2 * 3 * 4 - ou 3 1 2 * * 4 -
50 * (5 - (10 / 9)) >> 5 10 9 / - 50 *
3 + 4 >> 3 4 +
((1 _ 2) _ 3) - 4 >> 1 2 _ 3 _ 4 - ou 3 1 2 \* _ 4 -
50 _ (5 - (10 / 9)) >> 5 10 9 / - 50 \*
Here is how to evaluate a formula in RPN:
@ -34,6 +34,7 @@ Here is how to evaluate a formula in RPN:
6 4 -
2
```
Or:
```
@ -42,7 +43,8 @@ Or:
6 4 -
2
```
Examples of outputs :
### Usage
```console
student@ubuntu:~/student/rpncalc$ go build

37
subjects/rpncalc.fr.md

@ -2,31 +2,26 @@
### Instructions
Write a program that takes a string which contains an equation written in
Reverse Polish notation (RPN) as its first argument, evaluates the equation, and
prints the result on the standard output followed by a newline.
Écrire un programme qui prend une `string` qui contient une équation écrite en `Reverse Polish Notation` (RPN) comme premier argument, qui évalue l'équation, et qui affiche le résultat sur la sortie standard suivi d'un newline(`'\n'`).
Reverse Polish Notation is a mathematical notation in which every operator
follows all of its operands. In RPN, every operator encountered evaluates the
previous 2 operands, and the result of this operation then becomes the first of
the two operands for the subsequent operator. Operands and operators must be
spaced by at least one space.
La `Reverse Polish Notation` est une notation mathématique dans laquelle chaque opérateur devance les valeurs qu'il va opérer.
En RPN, chaque opérateur évalue les deux précédentes valeurs, et le résultat de cette opération devient ensuite la première des valeurs de l'opérateur. Les valeurs et les opérateurs doivent être espacés d'au moins un espace.
The following operators must be implemented : `+`, `-`, `*`, `/`, and `%`.
Les opérateurs suivants doivent être implémentés : `+`, `-`, `*`, `/`, et `%`.
If the string is not valid or if there is not exactly one argument, `Error` must be printed
on the standard output followed by a newline.
If the string has extra spaces it is still valid.
Si la `string` n'est pas valide ou si il n'y pas exactement un argument, le mot `Error` doit être affiché
sur la sortie standard suivi d'un newline.
Si la `string` a des espaces extra elle est toujours considérée valide.
All the given operands must fit in a `int`.
Toutes les valeurs données doivent rentrer dans un `int`.
Examples of formulas converted in RPN:
Exemples de formules converties en RPN:
3 + 4 >> 3 4 +
((1 * 2) * 3) - 4 >> 1 2 * 3 * 4 - ou 3 1 2 * * 4 -
50 * (5 - (10 / 9)) >> 5 10 9 / - 50 *
3 + 4 >> 3 4 +
((1 _ 2) _ 3) - 4 >> 1 2 _ 3 _ 4 - ou 3 1 2 \* _ 4 -
50 _ (5 - (10 / 9)) >> 5 10 9 / - 50 \*
Here is how to evaluate a formula in RPN:
Voici comment évaluer une formule en RPN:
```
1 2 * 3 * 4 -
@ -34,7 +29,8 @@ Here is how to evaluate a formula in RPN:
6 4 -
2
```
Or:
ou:
```
3 1 2 * * 4 -
@ -42,7 +38,8 @@ Or:
6 4 -
2
```
Examples of outputs :
### Utilisation
```console
student@ubuntu:~/student/rpncalc$ go build

2
subjects/searchreplace.en.md

@ -4,7 +4,7 @@
Write a program that takes 3 arguments, the first argument is a `string` in which to replace a letter (the 2nd argument) by another one (the 3rd argument).
- If the number of arguments is not 3, the program displays a newline(`'\n'`).
- If the number of arguments is different from 3, the program displays a newline(`'\n'`).
- If the second argument is not contained in the first one (the string) then the program rewrites the `string` followed by a newline(`'\n'`).

18
subjects/sortlist.fr.md

@ -2,21 +2,21 @@
### Instructions
Write a function that must:
Écrire une fonction qui doit :
- Sort the list given as a parameter, using the function cmp to select the order to apply,
- Trier la liste donnée en paramètre en utilisant la fonction cmp pour sélectionner l'ordre à appliquer,
- Return a pointer to the first element of the sorted list.
- Retourner un pointeur au premier élément de la liste triée.
Duplications must remain.
Les duplications doivent rester.
Inputs will always be consistent.
Les inputs seront toujours valides.
The `type NodeList` must be used.
Le `type NodeList` doit être utilisé.
Functions passed as `cmp` will always return `true` if `a` and `b` are in the right order, otherwise it will return `false`.
Les fonctions passées comme `cmp` retourneront toujours `true` si `a` et `b` sont dans le bon ordre, sinon elles retourneront `false`.
### Expected function
### Fonction et structure attendues
```go
type Nodelist struct {
@ -29,7 +29,7 @@ func SortList (l *NodeList, cmp func(a,b int) bool) *NodeList{
}
```
- For example, the following function used as `cmp` will sort the list in ascending order :
- Par exemple, la fonction suivante utilisée comme `cmp` triera la liste dans l'ordre croissant :
```go
func ascending(a, b int) bool{

4
subjects/split.en.md

@ -2,9 +2,9 @@
### Instructions
Write a function that seperates the words of a `string` and puts them in a `string` array.
Write a function that separates the words of a `string` and puts them in a `string` array.
The separators are the characters of the charset `string` given in parameter.
The separators are the characters of the `charset string` given in parameter.
### Expected function

2
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 characté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

2
subjects/switchcase.en.md

@ -8,7 +8,7 @@ Write a program that takes a `string` and reverses the case of all its letters.
- The result must be followed by a newline(`'\n'`).
- If the number of arguments is not 1, the program displays a newline(`'\n'`).
- If the number of arguments is different from 1, the program displays a newline(`'\n'`).
### Usage

2
subjects/switchcase.fr.md

@ -8,7 +8,7 @@
- Le résultat doit être suivi d'un newline(`'\n'`).
- Si le nombre d'arguments n'est pas 1, le programme affiche program un newline(`'\n'`).
- Si le nombre d'arguments est différent de 1, le programme affiche un newline(`'\n'`).
### Utilisation

4
subjects/tabmult.md → subjects/tabmult.en.md

@ -4,9 +4,9 @@
Write a program that displays a number's multiplication table.
- The parameter will always be a strictly positive number that fits in an int, and said number times 9 will also fit in an int.
- The parameter will always be a strictly positive number that fits in an `int`. Said number multiplied by 9 will also fit in an `int`.
Examples of outputs :
### Usage
```console
student@ubuntu:~/piscine/test$ go build

36
subjects/tabmult.fr.md

@ -0,0 +1,36 @@
## tabmult
### Instructions
Écrire un programme qui affiche la table de multiplication d'un nombre.
- Le paramètre sera toujours un nombre strictement positif qui rentre dans un `int`. Ce paramètre multiplié par 9 rentrera aussi dans un `int`.
### Utilisation
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test 9
1 x 9 = 9
2 x 9 = 18
3 x 9 = 27
4 x 9 = 36
5 x 9 = 45
6 x 9 = 54
7 x 9 = 63
8 x 9 = 72
9 x 9 = 81
student@ubuntu:~/piscine/test$ ./test 19
1 x 19 = 19
2 x 19 = 38
3 x 19 = 57
4 x 19 = 76
5 x 19 = 95
6 x 19 = 114
7 x 19 = 133
8 x 19 = 152
9 x 19 = 171
student@ubuntu:~/piscine/test$
student@ubuntu:~/piscine/
```

2
subjects/union.en.md

@ -8,7 +8,7 @@ characters that appear in either one of the `strings`.
The display will be in the order characters appear in the command line, and
will be followed by a newline(`'\n'`).
If the number of arguments is not 2, the program displays newline(`'\n'`).
If the number of arguments is different from 2, the program displays newline(`'\n'`).
### Usage

2
subjects/union.fr.md

@ -6,7 +6,7 @@
L'affichage se fera dans l'ordre d'apparition des caractères de la ligne de commande, et il sera suivi d'un newline(`'\n'`).
Si le nombre d'arguments n'est pas 2, le programme affiche un newline(`'\n'`).
Si le nombre d'arguments est différent de 2, le programme affiche un newline(`'\n'`).
### Utilisation

12
subjects/wdmatch.en.md

@ -1,14 +1,14 @@
# wdmatch
## wdmatch
## Instructions
### Instructions
Write a program that takes two strings and checks whether it is possible to write the first string with characters from the second string, while respecting the order in which these characters appear in the second string.
Write a program that takes two `strings` and checks whether it is possible to write the first `string` with characters from the second `string`, while respecting the order in which these characters appear in the second `string`.
- If it is possible, the program displays the string followed by a `\n`, otherwise it simply displays a `\n`.
- If it is possible, the program displays the `string` followed by a newline(`'\n'`), otherwise it simply displays a newline.
- If the number of arguments is not 2, the program displays `\n`.
- If the number of arguments is different from 2, the program displays a newline.
Example of output :
### Usage
```console
student@ubuntu:~/piscine/test$ go build

12
subjects/wdmatch.fr.md

@ -1,14 +1,14 @@
# wdmatch
## wdmatch
## Instructions
### Instructions
Write a program that takes two strings and checks whether it is possible to write the first string with characters from the second string, while respecting the order in which these characters appear in the second string.
Écrire un programme qui prend deux `strings` et vérifie si il est possible d'écrire la première `string` avec des caractères de la deuxième `string`, tout en respectant l'ordre dans lequel ces caractères apparaissent dans la deuxième `string`.
- If it is possible, the program displays the string followed by a `\n`, otherwise it simply displays a `\n`.
- Si cela est possible, le programme affiche la `string` suivie par un newline(`'\n'`), autrement le programme affiche un newline.
- If the number of arguments is not 2, the program displays `\n`.
- Si le nombre d'arguments est différent de 2, le programme affiche un newline.
Example of output :
### Utilisation
```console
student@ubuntu:~/piscine/test$ go build

Loading…
Cancel
Save