Browse Source

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

pull/327/head
Christopher Fremond 5 years ago
parent
commit
f8b7d87a1b
  1. 2
      subjects/addprimesum.en.md
  2. 2
      subjects/addprimesum.fr.md
  3. 4
      subjects/fprime.en.md
  4. 4
      subjects/fprime.fr.md
  5. 7
      subjects/printhex.en.md
  6. 8
      subjects/printhex.fr.md
  7. 8
      subjects/repeatalpha.en.md
  8. 8
      subjects/repeatalpha.fr.md
  9. 6
      subjects/revwstr.en.md
  10. 6
      subjects/revwstr.fr.md
  11. 2
      subjects/rpncalc.en.md
  12. 53
      subjects/strlenprog.fr.md
  13. 2
      subjects/union.en.md

2
subjects/addprimesum.en.md

@ -14,7 +14,7 @@ student@ubuntu:~/piscine-go/test$ ./test 5
10
student@ubuntu:~/piscine-go/test$ ./test 7
17
student@ubuntu:~/piscine-go/test$ ./test 57
student@ubuntu:~/piscine-go/test$ ./test 5 7
0
student@ubuntu:~/piscine-go/test$
```

2
subjects/addprimesum.fr.md

@ -14,7 +14,7 @@ student@ubuntu:~/piscine-go/test$ ./test 5
10
student@ubuntu:~/piscine-go/test$ ./test 7
17
student@ubuntu:~/piscine-go/test$ ./test 57
student@ubuntu:~/piscine-go/test$ ./test 5 7
0
student@ubuntu:~/piscine-go/test$
```

4
subjects/fprime.en.md

@ -24,7 +24,9 @@ student@ubuntu:~/piscine-go/test$ ./test 804577
804577
student@ubuntu:~/piscine-go/test$ ./test 42
2*3*7
student@ubuntu:~/piscine-go/test$ ./test
student@ubuntu:~/piscine-go/test$ ./test a
student@ubuntu:~/piscine-go/test$ ./test 0
student@ubuntu:~/piscine-go/test$
```

4
subjects/fprime.fr.md

@ -24,7 +24,9 @@ student@ubuntu:~/piscine-go/test$ ./test 804577
804577
student@ubuntu:~/piscine-go/test$ ./test 42
2*3*7
student@ubuntu:~/piscine-go/test$ ./test
student@ubuntu:~/piscine-go/test$ ./test a
student@ubuntu:~/piscine-go/test$ ./test 0
student@ubuntu:~/piscine-go/test$
```

7
subjects/printhex.en.md

@ -5,6 +5,7 @@
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 different from 1, the program displays a newline.
- Error cases have to be handled as shown in the example below.
### Usage
@ -16,7 +17,9 @@ student@ubuntu:~/piscine-go/test$ ./test "255"
ff
student@ubuntu:~/piscine-go/test$ ./test "5156454"
4eae66
student@ubuntu:~/piscine-go/test$
student@ubuntu:~/piscine-go/test$ ./test
student@ubuntu:~/piscine-go/
student@ubuntu:~/piscine-go/test$ ./test "123 132 1" | cat -e
0$
student@ubuntu:~/piscine-go/test$
```

8
subjects/printhex.fr.md

@ -5,6 +5,8 @@
É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 retour à la ligne (`'\n'`).
- Si le nombre de paramètres est différent de 1, le programme affiche un retour à la ligne.
- Les cas d'erreurs doivent être gérés comme montré dans l'exemple ci-dessous.
### Utilisation
@ -16,7 +18,9 @@ student@ubuntu:~/piscine-go/test$ ./test "255"
ff
student@ubuntu:~/piscine-go/test$ ./test "5156454"
4eae66
student@ubuntu:~/piscine-go/test$
student@ubuntu:~/piscine-go/test$ ./test
student@ubuntu:~/piscine-go/
student@ubuntu:~/piscine-go/test$ ./test "123 132 1" | cat -e
0$
student@ubuntu:~/piscine-go/test$
```

8
subjects/repeatalpha.en.md

@ -19,10 +19,10 @@ If the number of arguments is different from 1, the program displays a newline (
student@ubuntu:~/piscine-go/repeatalpha$ go build
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha "abc" | cat -e
abbccc
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha "Alex." | cat -e
Alllllllllllleeeeexxxxxxxxxxxxxxxxxxxxxxxx.$
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha "abacadaba 42!" | cat -e
abbacccaddddabba 42!$
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha "Choumi." | cat -e
CCChhhhhhhhooooooooooooooouuuuuuuuuuuuuuuuuuuuummmmmmmmmmmmmiiiiiiiii.$
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha "abacadaba 01!" | cat -e
abbacccaddddabba 01!$
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha | cat -e
$
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha "" | cat -e

8
subjects/repeatalpha.fr.md

@ -18,10 +18,10 @@ Si le nombre d'arguments est différent de 1, le programme affiche un retour à
student@ubuntu:~/piscine-go/repeatalpha$ go build
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha "abc" | cat -e
abbccc
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha "Alex." | cat -e
Alllllllllllleeeeexxxxxxxxxxxxxxxxxxxxxxxx.$
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha "abacadaba 42!" | cat -e
abbacccaddddabba 42!$
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha "Choumi." | cat -e
CCChhhhhhhhooooooooooooooouuuuuuuuuuuuuuuuuuuuummmmmmmmmmmmmiiiiiiiii.$
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha "abacadaba 01!" | cat -e
abbacccaddddabba 01!$
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha | cat -e
$
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha "" | cat -e

6
subjects/revwstr.en.md

@ -20,7 +20,7 @@ student@ubuntu:~/piscine-go/test$ ./test "abcdefghijklm"
abcdefghijklm
student@ubuntu:~/piscine-go/test$ ./test "he stared at the mountain"
mountain the at stared he
student@ubuntu:~/piscine-go/test$ ./test
student@ubuntu:~/piscine-go/test$
student@ubuntu:~/piscine-go/test$ ./test "" | cat-e
$
student@ubuntu:~/piscine-go/test$
```

6
subjects/revwstr.fr.md

@ -20,7 +20,7 @@ student@ubuntu:~/piscine-go/test$ ./test "abcdefghijklm"
abcdefghijklm
student@ubuntu:~/piscine-go/test$ ./test "he stared at the mountain"
mountain the at stared he
student@ubuntu:~/piscine-go/test$ ./test
student@ubuntu:~/piscine-go/test$
student@ubuntu:~/piscine-go/test$ ./test "" | cat-e
$
student@ubuntu:~/piscine-go/test$
```

2
subjects/rpncalc.en.md

@ -23,7 +23,7 @@ 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 -
((1 _ 2) _ 3) - 4 >> 1 2 _ 3 _ 4 - or 3 1 2 \* _ 4 -
50 _ (5 - (10 / 9)) >> 5 10 9 / - 50 \*
Here is how to evaluate a formula in RPN:

53
subjects/strlenprog.fr.md

@ -1,19 +1,52 @@
## strlenprog
##**AVERTISSEMENT! TRÈS IMPORTANT!**
Pour cet exercice une fonction sera testée **avec le main de l'examen**. Cependant l'étudiant **doit quand même** rendre un programme structuré:
Cela signifie que:
- Le package doit être nommé `package main`.
- Le code rendu doit avoir une fonction main déclarée(```func main()```) même si elle est vide.
- La fonction main déclarée doit **aussi passer** le `Restrictions Checker`(le testeur de fonctions illégales). Il est conseillé à l'étudiant de rendre une fonction main vide après ses tests finis.
- Toutes les autres régles sont les mêmes que pour un `programme`.
### Instructions
- Écrire un programme qui compte le nombre de caractères d'une `string` 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é.
- Si le programme reçoit plusieurs ou aucun arguments il ne doit rien afficher.
### Fonction attendue
```go
func StrLen(str string) int {
}
```
### Utilisation
Voici un éventuel [programme](TODO-LINK) pour tester votre fonction :
```go
package main
import (
"fmt"
piscine ".."
)
func main() {
str := "Hello World!"
nb := piscine.StrLen(str)
fmt.Println(nb)
}
```
### Utilisation :
Et son résultat :
```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$
student@ubuntu:~/piscine-go/test$ go build
student@ubuntu:~/piscine-go/test$ ./test
12
student@ubuntu:~/piscine-go/test$
```

2
subjects/unionEx.en.md → subjects/union.en.md

@ -6,7 +6,7 @@ Write a program that takes two `string` and displays, without doubles, the chara
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 different from 2, the program displays newline (`'\n'`).
If the number of arguments is different from 2, then the program displays newline (`'\n'`).
### Usage
Loading…
Cancel
Save