Browse Source

review of corrections and translation of rectangle subject

content-update
Christopher Fremond 5 years ago
parent
commit
84696026f8
  1. 2
      subjects/collatzcountdown.en.md
  2. 10
      subjects/collatzcountdown.fr.md
  3. 24
      subjects/doop.fr.md
  4. 6
      subjects/rectangle.en.md
  5. 19
      subjects/rectangle.fr.md
  6. 2
      subjects/split.fr.md

2
subjects/collatzcountdown.en.md

@ -4,7 +4,7 @@
Write a function, `CollatzCountdown`, that returns the number of steps necessary to reach 1 using the collatz countdown.
- It must return `-1` if `start` is 0 or negative.
- It must return `-1` if `start` is equal to `0` or negative.
### Expected function

10
subjects/collatzcountdown.fr.md

@ -4,9 +4,9 @@
Écrire une fonction, `CollatzCountdown`, qui retournes le nombre d'étapes nécéssaires pour atteindre 1 en utilisant le comptage de collatz.
- Il doit renvoyer `-1` si `start` est égal à 0 ou négatif.
- Elle doit renvoyer `-1` si `start` est égal à 0 ou négatif.
### FOnction attendue
### Fonction attendue
```go
func CollatzCountdown(start int) int {
@ -35,8 +35,8 @@ func main() {
Et son résultat :
```console
student@ubuntu:~/student/test$ go build
student@ubuntu:~/student/test$ ./test
student@ubuntu:~/piscine-go/test$ go build
student@ubuntu:~/piscine-go/test$ ./test
10
student@ubuntu:~/student/test$
student@ubuntu:~/piscine-go/test$
```

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

6
subjects/rectangle.en.md

@ -11,9 +11,9 @@ is defined by the points of the upper left and lower right corners.
- The struct `rectangle` has to have two variables, `upLeft` and `downRight` type `point`.
- Our main task is to make a program that:
- Given a slice of points of size `n` returns the smallest rectangle that contains all the points in the vector of points. The name of that function is `defineRectangle`.
- And calculates and prints the area of that rectangle you define.
- The goal is to make a program that:
- Given a slice of points of size `n` returns the smallest rectangle that contains all the points in the vector of points. The name of that function is `defineRectangle`.
- And which calculates and prints the area of that rectangle you define.
### Expected main and function for the program

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 {

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

Loading…
Cancel
Save