mirror of https://github.com/01-edu/public.git
Christopher Fremond
5 years ago
51 changed files with 672 additions and 198 deletions
@ -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. |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
@ -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$ |
||||
``` |
Loading…
Reference in new issue