Browse Source

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

pull/302/head
Christopher Fremond 5 years ago
parent
commit
d295bc48b5
  1. BIN
      docs/img/reviews/Screenshot 2019-10-17 at 01.59.32.png
  2. BIN
      docs/img/reviews/Screenshot 2019-10-17 at 02.03.11.png
  3. BIN
      docs/img/reviews/Screenshot 2019-10-17 at 02.05.46.png
  4. BIN
      docs/img/reviews/Screenshot 2019-10-17 at 02.20.18.png
  5. BIN
      docs/img/reviews/Screenshot 2019-10-17 at 02.22.30.png
  6. BIN
      docs/img/reviews/Screenshot 2019-10-17 at 02.24.04.png
  7. BIN
      docs/img/reviews/Screenshot 2019-10-17 at 02.43.31.png
  8. 50
      docs/reviews.md
  9. 9
      docs/server-requirements.md
  10. 6
      scripts/bash_tweaks.sh
  11. 6
      scripts/clean.sh
  12. 32
      scripts/exam.sh
  13. 8
      scripts/firewall.sh
  14. 6
      scripts/fx.sh
  15. 6
      scripts/go.sh
  16. 6
      scripts/grub.sh
  17. 9
      scripts/install_client.sh
  18. 6
      scripts/libreoffice.sh
  19. 6
      scripts/nodejs.sh
  20. 2
      scripts/set.sh
  21. 6
      scripts/ssh.sh
  22. 6
      scripts/sublime.sh
  23. 4
      scripts/system/etc/gdm3/PostLogin/Default
  24. 6
      scripts/system/etc/gdm3/PostSession/Default
  25. 2
      scripts/system/usr/local/bin/lock_screen
  26. 2
      scripts/system/usr/local/bin/suspend_session
  27. 6
      scripts/ubuntu_tweaks.sh
  28. 13
      scripts/vscode.sh
  29. 2
      subjects/addprimesum.en.md
  30. 4
      subjects/addprimesum.fr.md
  31. 1
      subjects/advancedsortwordarr.en.md
  32. 1
      subjects/advancedsortwordarr.fr.md
  33. 14
      subjects/alphamirror.en.md
  34. 16
      subjects/alphamirror.fr.md
  35. 1
      subjects/any.en.md
  36. 5
      subjects/any.fr.md
  37. 3
      subjects/appendrange.en.md
  38. 2
      subjects/appendrange.fr.md
  39. 2
      subjects/atoi.en.md
  40. 2
      subjects/atoi.fr.md
  41. 38
      subjects/atoibaseprog.en.md
  42. 38
      subjects/atoibaseprog.fr.md
  43. 4
      subjects/basicatoi.en.md
  44. 4
      subjects/basicatoi.fr.md
  45. 6
      subjects/basicatoi2.en.md
  46. 4
      subjects/basicatoi2.fr.md
  47. 8
      subjects/boolean.en.md
  48. 10
      subjects/boolean.fr.md
  49. 24
      subjects/brackets.en.md
  50. 21
      subjects/brackets.fr.md
  51. 30
      subjects/brainfuck.en.md
  52. 32
      subjects/brainfuck.fr.md
  53. 6
      subjects/btreeapplybylevel.en.md
  54. 6
      subjects/btreeapplybylevel.fr.md
  55. 3
      subjects/btreeapplyinorder.en.md
  56. 3
      subjects/btreeapplyinorder.fr.md
  57. 2
      subjects/btreeapplypostorder.fr.md
  58. 2
      subjects/btreeapplypreorder.fr.md
  59. 7
      subjects/btreedeletenode.en.md
  60. 7
      subjects/btreedeletenode.fr.md
  61. 4
      subjects/btreeinsertdata.en.md
  62. 3
      subjects/btreeinsertdata.fr.md
  63. 6
      subjects/btreeisbinary.en.md
  64. 6
      subjects/btreeisbinary.fr.md
  65. 6
      subjects/btreelevelcount.en.md
  66. 6
      subjects/btreelevelcount.fr.md
  67. 6
      subjects/btreemax.en.md
  68. 6
      subjects/btreemax.fr.md
  69. 6
      subjects/btreemin.en.md
  70. 6
      subjects/btreemin.fr.md
  71. 6
      subjects/btreetransplant.en.md
  72. 6
      subjects/btreetransplant.fr.md
  73. 2
      subjects/capitalizeprog.fr.md
  74. 9
      subjects/cat.en.md
  75. 9
      subjects/cat.fr.md
  76. 2
      subjects/comcheck.en.md
  77. 4
      subjects/comcheck.fr.md
  78. 2
      subjects/compact.fr.md
  79. 2
      subjects/compareprog.en.md
  80. 2
      subjects/compareprog.fr.md
  81. 1
      subjects/concatparams.fr.md
  82. 1
      subjects/convertbase.en.md
  83. 1
      subjects/convertbase.fr.md
  84. 3
      subjects/countdown.en.md
  85. 2
      subjects/countdown.fr.md
  86. 1
      subjects/countif.en.md
  87. 1
      subjects/countif.fr.md
  88. 2
      subjects/displaya.fr.md
  89. 6
      subjects/displayalpham.en.md
  90. 8
      subjects/displayalpham.fr.md
  91. 6
      subjects/displayalrevm.en.md
  92. 8
      subjects/displayalrevm.fr.md
  93. 8
      subjects/displayfile.en.md
  94. 8
      subjects/displayfile.fr.md
  95. 2
      subjects/displayfirstparam.en.md
  96. 2
      subjects/displayfirstparam.fr.md
  97. 2
      subjects/displaylastparam.en.md
  98. 2
      subjects/displaylastparam.fr.md
  99. 5
      subjects/displayz.en.md
  100. 2
      subjects/displayz.fr.md
  101. Some files were not shown because too many files changed in this diff diff.show_more

BIN
docs/img/reviews/Screenshot 2019-10-17 at 01.59.32.png

diff.bin_not_shown

After

Width:  |  Height:  |  Size: 638 KiB

BIN
docs/img/reviews/Screenshot 2019-10-17 at 02.03.11.png

diff.bin_not_shown

After

Width:  |  Height:  |  Size: 1.4 MiB

BIN
docs/img/reviews/Screenshot 2019-10-17 at 02.05.46.png

diff.bin_not_shown

After

Width:  |  Height:  |  Size: 707 KiB

BIN
docs/img/reviews/Screenshot 2019-10-17 at 02.20.18.png

diff.bin_not_shown

After

Width:  |  Height:  |  Size: 707 KiB

BIN
docs/img/reviews/Screenshot 2019-10-17 at 02.22.30.png

diff.bin_not_shown

After

Width:  |  Height:  |  Size: 725 KiB

BIN
docs/img/reviews/Screenshot 2019-10-17 at 02.24.04.png

diff.bin_not_shown

After

Width:  |  Height:  |  Size: 734 KiB

BIN
docs/img/reviews/Screenshot 2019-10-17 at 02.43.31.png

diff.bin_not_shown

After

Width:  |  Height:  |  Size: 643 KiB

50
docs/reviews.md

@ -0,0 +1,50 @@
# Reviews
## Context
Only unblocked bonus exercises can be reviewed, which are usually the last items of a quest.
Bonus exercises are available in quests 02 / 03 / 04 / 05 / 07 / 08 / 09.
<img width="1073" alt="Screenshot 2019-10-17 at 02.43.31" src="img/reviews/Screenshot 2019-10-17 at 02.43.31.png">
Making a review involves 2 students who are goning to review each other's exercise.
Each user has to :
- **check** the code of the other one on Github
- **bet** if it is going to fail or succeed in the Review interface
- **run** his own exercise in the Review interface to give a result to compare with the bet, and state if it was right or wrong
## Usage
To submit an exercise to review and be reviewed, go to the `Review panel` on the right of the quest interface and click on the button to submit it :
<img width="1073" alt="Screenshot 2019-10-17 at 01.59.32" src="img/reviews/Screenshot 2019-10-17 at 01.59.32.png">
Then, when a match with another student who also wants to review is found, you will be notified :
<img width="1073" alt="Screenshot 2019-10-17 at 02.03.11" src="img/reviews/Screenshot 2019-10-17 at 02.03.11.png">
Once you and the other student have confirmed the match, you can go and check the code of the other student on his repository in the component `Your review` :
<img width="1073" alt="Screenshot 2019-10-17 at 02.05.46" src="img/reviews/Screenshot 2019-10-17 at 02.05.46.png">
When you have checked his code, those 4 steps will have to be completed to achieve the review :
- You have to bet if the exercise of the other student will fail or succeed after running the tester
- The other student has to do the same with your exercise and make his own bet, that you will see on the component `Review of your exercise`
<img width="1073" alt="Screenshot 2019-10-17 at 02.20.18" src="img/reviews/Screenshot 2019-10-17 at 02.20.18.png">
- Once the other student's bet is set, the tester button unblocks and you have to run it on your exercise to output the result determining if your exercise has failed or succeeded ; this result is compared to the other student's bet to determine if it was wrong or right
- The other student also has to run the tester on his exercise to determine his result and so if your bet was wrong or right
<img width="1073" alt="Screenshot 2019-10-17 at 02.22.30" src="img/reviews/Screenshot 2019-10-17 at 02.22.30.png">
In fact, a bet is succeeded if it is equal to the tester output :
<img width="1073" alt="Screenshot 2019-10-17 at 02.24.04" src="img/reviews/Screenshot 2019-10-17 at 02.24.04.png">
You can have those 4 cases :
| bet | tester output | bet result |
| ------- | ------------- | ------------- |
| fail | failed | **succeeded** |
| fail | succeeded | **failed** |
| succeed | succeeded | **succeeded** |
| succeed | failed | **failed** |

9
docs/server-requirements.md

@ -0,0 +1,9 @@
# Server requirements
**Linux compatible only**
| Component | Recommended specifications |
| --------- | --------------------------------- |
| Processor | 16 threads x86-64 (64 bits) |
| Memory | 64 GB ECC DDR4 2133 Mhz frequency |
| Disk | 500 GB SSD NVMe |

6
scripts/bash_tweaks.sh

@ -1,9 +1,9 @@
#!/bin/bash
#!/usr/bin/env bash
# Configure Terminal
SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $SCRIPT_DIR
script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $script_dir
. set.sh
# Makes bash case-insensitive

6
scripts/clean.sh

@ -1,9 +1,9 @@
#!/bin/bash
#!/usr/bin/env bash
# Clean system
SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $SCRIPT_DIR
script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $script_dir
. set.sh
# Purge useless packages

32
scripts/exam.sh

@ -0,0 +1,32 @@
#!/usr/bin/env bash
# Install Exam app
script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $script_dir
. set.sh
wget https://github.com/01-edu/public/releases/download/exam/exam.1.0.0.AppImage -O /usr/local/bin/exam.1.0.0.AppImage
chmod +x /usr/local/bin/exam.1.0.0.AppImage
cat <<EOF> /home/student/.local/share/applications/appimagekit-exam.desktop
[Desktop Entry]
Name=exam
Comment=the exam client
Exec="/usr/local/bin/exam.1.0.0.AppImage" %U
Terminal=false
Type=Application
Icon=appimagekit-exam
StartupWMClass=exam
X-AppImage-Version=1.0.0
MimeType=x-scheme-handler/exam;
Categories=Utility;
X-AppImage-BuildId=1RHp8aPhkSgD1PXGL1NW5QDsbFF
X-Desktop-File-Install-Version=0.23
X-AppImage-Comment=Generated by /tmp/.mount_exam.1PqfsDP/AppRun
TryExec=/usr/local/bin/exam.1.0.0.AppImage
EOF
chown student:student /home/student/.local/share/applications/appimagekit-exam.desktop
sudo -iu student xdg-mime default appimagekit-exam.desktop x-scheme-handler/exam
sudo -iu student go get github.com/01-edu/z01

8
scripts/firewall.sh

@ -1,9 +1,9 @@
#!/bin/bash
#!/usr/bin/env bash
# Install firewall
SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $SCRIPT_DIR
script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $script_dir
. set.sh
SSH_PORT=${1:-521}
@ -12,4 +12,6 @@ apt-get -y install ufw
ufw logging off
ufw allow in "$SSH_PORT"/tcp
ufw allow in 27960:27969/tcp
ufw allow in 27960:27969/udp
ufw --force enable

6
scripts/fx.sh

@ -1,9 +1,9 @@
#!/bin/bash
#!/usr/bin/env bash
# Install FX: command-line JSON processing tool (https://github.com/antonmedv/fx)
SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $SCRIPT_DIR
script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $script_dir
. set.sh
npm install -g fx

6
scripts/go.sh

@ -1,9 +1,9 @@
#!/bin/bash
#!/usr/bin/env bash
# Install Go
SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $SCRIPT_DIR
script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $script_dir
. set.sh
apt-get -y install golang

6
scripts/grub.sh

@ -1,9 +1,9 @@
#!/bin/bash
#!/usr/bin/env bash
# Install Grub
SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $SCRIPT_DIR
script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $script_dir
. set.sh
DISK=$1

9
scripts/install_client.sh

@ -1,12 +1,12 @@
#!/bin/bash
#!/usr/bin/env bash
# Configure Z01 client
# Log stdout & stderr
exec > >(tee -i /tmp/install_client.log) 2>&1
SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $SCRIPT_DIR
script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $script_dir
. set.sh
SSH_PORT=521
@ -48,6 +48,7 @@ apt-get -yf install
. sublime.sh
. vscode.sh
. libreoffice.sh
. exam.sh
# Install additional packages
PKGS="
@ -99,7 +100,7 @@ cd /tmp/system
cp --preserve=mode -RT . /
cd $SCRIPT_DIR
cd $script_dir
rm -rf /tmp/system
apt-get -y install overlayroot

6
scripts/libreoffice.sh

@ -1,9 +1,9 @@
#!/bin/bash
#!/usr/bin/env bash
# Install VSCode
SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $SCRIPT_DIR
script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $script_dir
. set.sh
apt-get -y install libreoffice

6
scripts/nodejs.sh

@ -1,9 +1,9 @@
#!/bin/bash
#!/usr/bin/env bash
# Install Node.js
SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $SCRIPT_DIR
script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $script_dir
. set.sh
curl -sL https://deb.nodesource.com/setup_12.x | bash -

2
scripts/set.sh

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Set scripting variables

6
scripts/ssh.sh

@ -1,9 +1,9 @@
#!/bin/bash
#!/usr/bin/env bash
# Install OpenSSH
SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $SCRIPT_DIR
script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $script_dir
. set.sh
SSH_PORT=${1:-521}

6
scripts/sublime.sh

@ -1,9 +1,9 @@
#!/bin/bash
#!/usr/bin/env bash
# Install Sublime Text & Sublime Merge
SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $SCRIPT_DIR
script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $script_dir
. set.sh
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | apt-key add -

4
scripts/system/etc/gdm3/PostLogin/Default

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Mount home as an overlay filesystem
@ -46,3 +46,5 @@ temp_path=/mnt/.01/tmp
mkdir -p "$user_path" "$temp_path"
chown -R "$USER":"$USER" "$user_path" "$temp_path"
mount -t overlay -o lowerdir="$HOME",upperdir="$user_path",workdir="$temp_path" overlay "$HOME"
mkdir -p "$HOME"/.cache
mount -t tmpfs -o size=2G tmpfs "$HOME"/.cache

6
scripts/system/etc/gdm3/PostSession/Default

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Log stdout & stderr
exec > >(tee -i /tmp/gdm3_postsession.log) 2>&1
@ -21,6 +21,6 @@ systemctl stop user@1000.service
# Make sure the mountpoints are free
kill $(lsof -t "$HOME" /mnt) $(ps --no-headers -u "$USER" -o pid)
umount "$HOME" /mnt
umount "$HOME"/.cache "$HOME" /mnt
umount /dev/disk/by-partlabel/01-home ||:
wipefs -a /dev/disk/by-partlabel/01-tmp-home
/usr/sbin/wipefs -a /dev/disk/by-partlabel/01-tmp-home

2
scripts/system/usr/local/bin/lock_screen

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Exits if a command fails
set -e

2
scripts/system/usr/local/bin/suspend_session

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Exits if a command fails
set -e

6
scripts/ubuntu_tweaks.sh

@ -1,9 +1,9 @@
#!/bin/bash
#!/usr/bin/env bash
# Configure ubuntu desktop systems
SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd "$SCRIPT_DIR"
script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd "$script_dir"
. set.sh
# Install dependencies

13
scripts/vscode.sh

@ -1,21 +1,16 @@
#!/bin/bash
#!/usr/bin/env bash
# Install VSCode
SCRIPT_DIR="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $SCRIPT_DIR
script_dir="$(cd -P "$(dirname "$BASH_SOURCE")" && pwd)"
cd $script_dir
. set.sh
wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | apt-key add -
echo 'deb https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs/ vscodium main' > /etc/apt/sources.list.d/vscodium.list
apt-get update && apt-get -y install codium
cat <<EOF> /usr/local/bin/code
#!/usr/bin/env bash
/usr/share/codium/codium &>/dev/null &
EOF
chmod +x /usr/local/bin/code
ln -s /usr/bin/codium /usr/local/bin/code
# Set-up all users
for DIR in $(ls -1d /home/* 2>/dev/null || true)

2
subjects/addprimesum.en.md

@ -2,7 +2,7 @@
### 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(`'\n`').
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 different from 1, or if the argument is not a positive number, the program displays `0` followed by a newline.

4
subjects/addprimesum.fr.md

@ -2,9 +2,9 @@
### Instructions
É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`').
É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 retour à la ligne (`'\n'`).
- 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.
- 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 retour à la ligne.
### Utilisation

1
subjects/advancedsortwordarr.en.md

@ -8,6 +8,7 @@ Write a function `AdvancedSortWordArr` that sorts a `string` array, based on the
```go
func AdvancedSortWordArr(array []string, f func(a, b string) int) {
}
```

1
subjects/advancedsortwordarr.fr.md

@ -8,6 +8,7 @@
```go
func AdvancedSortWordArr(array []string, f func(a, b string) int) {
}
```

14
subjects/alphamirror.en.md

@ -2,9 +2,7 @@
### Instructions
Write a program called `alphamirror` that takes a `string` as argument and displays this `string`
after replacing each alphabetical character with the opposite alphabetical
character.
Write a program called `alphamirror` that takes a `string` as argument and displays this `string` after replacing each alphabetical character with the opposite alphabetical character.
The case of the letter stays the same, for example :
@ -18,12 +16,12 @@ If the number of arguments is different from 1, the program displays only a newl
### Usage
```console
student@ubuntu:~/student/alphamirror$ go build
student@ubuntu:~/student/alphamirror$ ./alphamirror "abc"
student@ubuntu:~/piscine-go/alphamirror$ go build
student@ubuntu:~/piscine-go/alphamirror$ ./alphamirror "abc"
zyx
student@ubuntu:~/student/alphamirror$ ./alphamirror "My horse is Amazing." | cat -e
student@ubuntu:~/piscine-go/alphamirror$ ./alphamirror "My horse is Amazing." | cat -e
Nb slihv rh Znzarmt.$
student@ubuntu:~/student/alphamirror$ ./alphamirror | cat -e
student@ubuntu:~/piscine-go/alphamirror$ ./alphamirror | cat -e
$
student@ubuntu:~/student/alphamirror$
student@ubuntu:~/piscine-go/alphamirror$
```

16
subjects/alphamirror.fr.md

@ -2,26 +2,26 @@
### Instructions
Écrire un programme nommé `alphamirror` qui prend une `string` come argument et qui affiche cette `string` après remplacement de chaque caractère alphabétique avec son opposé.
Écrire un programme nommé `alphamirror` qui prend une `string` comme argument et qui affiche cette `string` après remplacement de chaque caractère alphabétique avec son opposé.
Les majuscules restent des majuscules, de même pour le minuscules, par exemple :
'a' devient 'z', 'Z' devient 'A'
'd' devient 'w', 'M' devient 'N'
Le résultat final sera suivi d'un newline(`'\n'`).
Le résultat final sera suivi d'un retour à la ligne (`'\n'`).
Si le nombre d'arguments est différent de 1, le programme affiche seulement un newline(`'\n'`).
Si le nombre d'arguments est différent de 1, le programme affiche seulement un retour à la ligne (`'\n'`).
### Utilisation
```console
student@ubuntu:~/student/alphamirror$ go build
student@ubuntu:~/student/alphamirror$ ./alphamirror "abc"
student@ubuntu:~/piscine-go/alphamirror$ go build
student@ubuntu:~/piscine-go/alphamirror$ ./alphamirror "abc"
zyx
student@ubuntu:~/student/alphamirror$ ./alphamirror "My horse is Amazing." | cat -e
student@ubuntu:~/piscine-go/alphamirror$ ./alphamirror "My horse is Amazing." | cat -e
Nb slihv rh Znzarmt.$
student@ubuntu:~/student/alphamirror$ ./alphamirror | cat -e
student@ubuntu:~/piscine-go/alphamirror$ ./alphamirror | cat -e
$
student@ubuntu:~/student/alphamirror$
student@ubuntu:~/piscine-go/alphamirror$
```

1
subjects/any.en.md

@ -10,6 +10,7 @@ Write a function `Any` that returns `true`, for a `string` array:
```go
func Any(f func(string) bool, arr []string) bool {
}
```

5
subjects/any.fr.md

@ -2,14 +2,15 @@
### Instructions
Écrire une fonction `Any` qui retournes `true`, pour un tableau de `string`:
Écrire une fonction `Any` qui retourne `true`, pour un tableau de `string` :
- si, lorsque ce tableau de `string` est passé à travers une fonction `f`, au moins un element retournes `true`.
- si, lorsque ce tableau de `string` est passé à travers une fonction `f`, au moins un element retourne `true`.
### Fonction attendue
```go
func Any(f func(string) bool, arr []string) bool {
}
```

3
subjects/appendrange.en.md

@ -2,8 +2,7 @@
### Instructions
Write a function that takes an `int` min and an `int` max as parameters.
That function returns a slice of `int` with all the values between min and max.
Write a function that takes an `int` min and an `int` max as parameters. That function returns a slice of `int` with all the values between min and max.
Min is included, and max is excluded.

2
subjects/appendrange.fr.md

@ -2,7 +2,7 @@
### Instructions
Écrire une fonction qui prend un `int` minimum et un `int` maximum comme paramètres. Cette fonction retournes une slice d'`int` avec toutes les valeurs comprises entre le minimum et le maximum.
Écrire une fonction qui prend un `int` minimum et un `int` maximum comme paramètres. Cette fonction retourne une slice d'`int` avec toutes les valeurs comprises entre le minimum et le maximum.
Le minimum est inclus, le maximum est exclu.

2
subjects/atoi.en.md

@ -8,7 +8,7 @@
- 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.
- This function will **only** have to return the `int`. For this exercise the `error` result of atoi is not required.
### Expected function

2
subjects/atoi.fr.md

@ -8,7 +8,7 @@
- Pour cet exercice la gestion des signes + ou - **doit être** prise en compte.
- Cette fonction aura **seulement** à retourner l'`int` (entier) `nbr`. Pour cet exercice le retour d'erreur d'atoi de go n'est pas demandé.
- Cette fonction aura **seulement** à retourner l'`int` (entier). Pour cet exercice le retour d'erreur d'atoi de go n'est pas demandé.
### Fonction attendue

38
subjects/atoibaseprog.en.md

@ -0,0 +1,38 @@
## atoibaseprog
### Instructions
Write a program that takes a `string` number and its `string` base as arguments and prints its conversion as an `int`.
- If the base or the `string` number is not valid it returns `0`.
- If the number of arguments is bigger or lower that two it should print a newline ("`\n`").
Validity rules for a base :
- A base must contain at least 2 characters.
- Each character of a base must be unique.
- A base should not contain `+` or `-` characters.
Only valid `string` numbers will be tested.
The program **does not have** to manage negative numbers.
### Expected output :
```console
student@ubuntu:~/atoibaseprog$ go build
student@ubuntu:~/atoibaseprog$ ./atoibaseprog 125 0123456789
125
student@ubuntu:~/atoibaseprog$ ./atoibaseprog 1111101 01
125
student@ubuntu:~/atoibaseprog$ ./atoibaseprog 7D 0123456789ABCDEF
125
student@ubuntu:~/atoibaseprog$ ./atoibaseprog uoi choumi | cat -e
125$
student@ubuntu:~/atoibaseprog$ ./atoibaseprog bbbbbab -ab | cat -e
0$
student@ubuntu:~/atoibaseprog$ ./atoibaseprog 1111101
student@ubuntu:~/atoibaseprog$
```

38
subjects/atoibaseprog.fr.md

@ -0,0 +1,38 @@
## atoibaseprog
### Instructions
Écrire un programme qui prend un nombre `string` et sa base `string` en paramètres et retourne sa conversion en `int`.
- Si la base ou le nombre `string` n'est pas valide le programme retourne `0`:
- Si le nombre d'argument est différent de deux alors le programme affiche un newline ("`\n`").
Règles de validité d'une base :
- 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.
La fonction **ne doit pas** gérer les nombres négatifs.
### Expected output :
```console
student@ubuntu:~/atoibaseprog$ go build
student@ubuntu:~/atoibaseprog$ ./atoibaseprog 125 0123456789
125
student@ubuntu:~/atoibaseprog$ ./atoibaseprog 1111101 01
125
student@ubuntu:~/atoibaseprog$ ./atoibaseprog 7D 0123456789ABCDEF
125
student@ubuntu:~/atoibaseprog$ ./atoibaseprog uoi choumi | cat -e
125$
student@ubuntu:~/atoibaseprog$ ./atoibaseprog bbbbbab -ab | cat -e
0$
student@ubuntu:~/atoibaseprog$ ./atoibaseprog 1111101
student@ubuntu:~/atoibaseprog$
```

4
subjects/basicatoi.en.md

@ -6,9 +6,9 @@
- Atoi returns `0` if the `string` is not considered as a valid number. For this exercise **only valid** `string` chains will be tested. They will only contain one or several digits as characters.
- For this exercise the handling of the signs + or - does not have to be taken into account.
- For this exercise the handling of the signs `+` or `-` does not 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.
- This function will **only** have to return the `int`. For this exercise the `error` return of atoi is not required.
### Expected function

4
subjects/basicatoi.fr.md

@ -6,9 +6,9 @@
- Atoi retourne `0` si la `string` n'est pas considéré un nombre valide. Pour cet exercice **seulement des** `string` **valides** seront testé. Elles ne contiendront que un ou plusieurs chiffres comme charact.
- Pour cet exercice la gestion des signes + ou - ne doit pas être prise en compte.
- Pour cet exercice la gestion des signes `+` ou `-` ne doit pas être prise en compte.
- Cette fonction aura **seulement** à retourner l'`int` (entier) `nbr`. Pour cet exercice le retour d'erreur d'atoi de go n'est pas demandé.
- Cette fonction aura **seulement** à retourner l'`int` (entier). Pour cet exercice le retour d'erreur d'atoi de go n'est pas demandé.
### Fonction attendue

6
subjects/basicatoi2.en.md

@ -6,11 +6,11 @@
- 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 not have to be taken into account.
- For this exercise the handling of the signs `+` or `-` does not 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.
- This function will **only** have to return the `int`. For this exercise the `error` return of atoi is not required.
### Expected Function
### Expected function
```go
func BasicAtoi2(s string) int {

4
subjects/basicatoi2.fr.md

@ -6,9 +6,9 @@
- 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.
- Pour cet exercice la gestion des signes `+` ou `-` ne doit pas être prise en compte.
- Cette fonction aura **seulement** à retourner l'`int` (entier) `nbr`. Pour cet exercice le retour d'erreur d'atoi de go n'est pas demandé.
- Cette fonction aura **seulement** à retourner l'`int` (entier). Pour cet exercice le retour d'erreur d'atoi de go n'est pas demandé.
### Fonction attendue

8
subjects/boolean.en.md

@ -39,12 +39,12 @@ func main() {
}
```
### Expected output
### Usage
```console
student@ubuntu:~/student/boolean$ go build
student@ubuntu:~/student/boolean$ ./boolean "not" "odd"
student@ubuntu:~/piscine-go/boolean$ go build
student@ubuntu:~/piscine-go/boolean$ ./boolean "not" "odd"
I have an even number of arguments
student@ubuntu:~/student/boolean$ ./boolean "not even"
student@ubuntu:~/piscine-go/boolean$ ./boolean "not even"
I have an odd number of arguments
```

10
subjects/boolean.fr.md

@ -6,7 +6,7 @@ Créer un fichier `.go`.
- Le code ci-dessous doit être copié dans ce fichier.
- Les changements nécéssaires doivent être appliquer pour que le programme fonctionne.
- Les changements nécéssaires doivent être appliqués pour que le programme fonctionne.
- Le programme doit être rendu dans un dossier nommé `boolean`.
@ -39,12 +39,12 @@ func main() {
}
```
### Usage
### Utilisation
```console
student@ubuntu:~/student/boolean$ go build
student@ubuntu:~/student/boolean$ ./boolean "not" "odd"
student@ubuntu:~/piscine-go/boolean$ go build
student@ubuntu:~/piscine-go/boolean$ ./boolean "not" "odd"
I have an even number of arguments
student@ubuntu:~/student/boolean$ ./boolean "not even"
student@ubuntu:~/piscine-go/boolean$ ./boolean "not even"
I have an odd number of arguments
```

24
subjects/brackets.en.md

@ -2,32 +2,26 @@
### Instructions
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.
Write a program that takes an undefined number of `string` 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 parentheses `(` and `)`, square brackets `[`
and `]` and curly 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 does not contain any bracket is considered as a
correctly bracketed `string`.
An opening bracket must always be closed by the good closing bracket in the 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.
### Usage
```console
student@ubuntu:~/student/brackets$ go build
student@ubuntu:~/student/brackets$ ./brackets '(johndoe)' | cat -e
student@ubuntu:~/piscine-go/brackets$ go build
student@ubuntu:~/piscine-go/brackets$ ./brackets '(johndoe)' | cat -e
OK$
student@ubuntu:~/student/brackets$ ./brackets '([)]' | cat -e
student@ubuntu:~/piscine-go/brackets$ ./brackets '([)]' | cat -e
Error$
student@ubuntu:~/student/brackets$ ./brackets '' '{[(0 + 0)(1 + 1)](3*(-1)){()}}' | cat -e
student@ubuntu:~/piscine-go/brackets$ ./brackets '' '{[(0 + 0)(1 + 1)](3*(-1)){()}}' | cat -e
OK$
OK$
student@ubuntu:~/student/brackets$ ./brackets | cat -e
student@ubuntu:~/piscine-go/brackets$ ./brackets | cat -e
$
student@ubuntu:~/student/brackets$
student@ubuntu:~/piscine-go/brackets$
```

21
subjects/brackets.fr.md

@ -2,29 +2,26 @@
### Instructions
É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.
Écrire un programme qui prend un nombre indéfini de `string` 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 retour à la ligne (`'\n'`), autrement il affiche `Error` suivi d'un retour à la ligne.
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é.
Les symboles considérés comme des parenthèses sont `(` et `)`, les crochets `[` et `]` et les accolades `{` et `}`. Tout autre symbole est simplement ignoré.
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".
Si il n'y a pas d'argument, le programme affiche seulement un newline.
Si il n'y a pas d'argument, le programme affiche seulement un retour à la ligne.
### Utilisation
```console
student@ubuntu:~/student/brackets$ go build
student@ubuntu:~/student/brackets$ ./brackets '(johndoe)' | cat -e
student@ubuntu:~/piscine-go/brackets$ go build
student@ubuntu:~/piscine-go/brackets$ ./brackets '(johndoe)' | cat -e
OK$
student@ubuntu:~/student/brackets$ ./brackets '([)]' | cat -e
student@ubuntu:~/piscine-go/brackets$ ./brackets '([)]' | cat -e
Error$
student@ubuntu:~/student/brackets$ ./brackets '' '{[(0 + 0)(1 + 1)](3*(-1)){()}}' | cat -e
student@ubuntu:~/piscine-go/brackets$ ./brackets '' '{[(0 + 0)(1 + 1)](3*(-1)){()}}' | cat -e
OK$
OK$
student@ubuntu:~/student/brackets$ ./brackets | cat -e
student@ubuntu:~/piscine-go/brackets$ ./brackets | cat -e
$
student@ubuntu:~/student/brackets$
student@ubuntu:~/piscine-go/brackets$
```

30
subjects/brainfuck.en.md

@ -5,33 +5,31 @@
Write a `Brainfuck` interpreter program.
The source code will be given as first parameter.
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.
`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 :
- '>' 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 (loop start) ;
- ']' go to the matching '[' if the pointed byte is not 0 (loop end).
- '>' 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 (loop start)
- ']' go to the matching '[' if the pointed byte is not 0 (loop end)
Any other character is a comment.
### Usage
```console
student@ubuntu:~/student/brainfuck$ go build
student@ubuntu:~/student/brainfuck$ ./brainfuck "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>." | cat -e
student@ubuntu:~/piscine-go/brainfuck$ go build
student@ubuntu:~/piscine-go/brainfuck$ ./brainfuck "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>." | cat -e
Hello World!$
student@ubuntu:~/student/brainfuck$ ./brainfuck "+++++[>++++[>++++H>+++++i<<-]>>>++\n<<<<-]>>--------.>+++++.>." | cat -e
student@ubuntu:~/piscine-go/brainfuck$ ./brainfuck "+++++[>++++[>++++H>+++++i<<-]>>>++\n<<<<-]>>--------.>+++++.>." | cat -e
Hi$
student@ubuntu:~/student/brainfuck$ ./brainfuck "++++++++++[>++++++++++>++++++++++>++++++++++<<<-]>---.>--.>-.>++++++++++." | cat -e
student@ubuntu:~/piscine-go/brainfuck$ ./brainfuck "++++++++++[>++++++++++>++++++++++>++++++++++<<<-]>---.>--.>-.>++++++++++." | cat -e
abc$
student@ubuntu:~/student/brainfuck$ ./brainfuck | cat -e
student@ubuntu:~/piscine-go/brainfuck$ ./brainfuck | cat -e
$
student@ubuntu:~/student/brainfuck$
student@ubuntu:~/piscine-go/brainfuck$
```

32
subjects/brainfuck.fr.md

@ -4,34 +4,32 @@
É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.
Le code sera toujours valide, avec moins de 4096 opérations.
Le `Brainfuck` est un langage minimaliste. Il consiste en un slice de `byte` (octets) (dans cet exercise 2048 octets) tous initialisés à zéro, et avec un pointeur sur le premier octet.
Chaque opérateur consiste en un seul caractère :
- '>' 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).
- '>' 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)
Tout autre caractère est un commentaire.
### Utilisation
```console
student@ubuntu:~/student/brainfuck$ go build
student@ubuntu:~/student/brainfuck$ ./brainfuck "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>." | cat -e
student@ubuntu:~/piscine-go/brainfuck$ go build
student@ubuntu:~/piscine-go/brainfuck$ ./brainfuck "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>." | cat -e
Hello World!$
student@ubuntu:~/student/brainfuck$ ./brainfuck "+++++[>++++[>++++H>+++++i<<-]>>>++\n<<<<-]>>--------.>+++++.>." | cat -e
student@ubuntu:~/piscine-go/brainfuck$ ./brainfuck "+++++[>++++[>++++H>+++++i<<-]>>>++\n<<<<-]>>--------.>+++++.>." | cat -e
Hi$
student@ubuntu:~/student/brainfuck$ ./brainfuck "++++++++++[>++++++++++>++++++++++>++++++++++<<<-]>---.>--.>-.>++++++++++." | cat -e
student@ubuntu:~/piscine-go/brainfuck$ ./brainfuck "++++++++++[>++++++++++>++++++++++>++++++++++<<<-]>---.>--.>-.>++++++++++." | cat -e
abc$
student@ubuntu:~/student/brainfuck$ ./brainfuck | cat -e
student@ubuntu:~/piscine-go/brainfuck$ ./brainfuck | cat -e
$
student@ubuntu:~/student/brainfuck$
student@ubuntu:~/piscine-go/brainfuck$
```

6
subjects/btreeapplybylevel.en.md

@ -36,11 +36,11 @@ func main() {
And its output :
```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
4
1
7
5
student@ubuntu:~/student/test$
student@ubuntu:~/piscine-go/test$
```

6
subjects/btreeapplybylevel.fr.md

@ -36,11 +36,11 @@ 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
4
1
7
5
student@ubuntu:~/student/test$
student@ubuntu:~/piscine-go/test$
```

3
subjects/btreeapplyinorder.en.md

@ -2,8 +2,7 @@
### Instructions
Write a function that applies a function in order to each element in the tree.
(see `in order tree walks`)
Write a function that applies a function in order to each element in the tree (see "in order tree walks").
### Expected function

3
subjects/btreeapplyinorder.fr.md

@ -2,8 +2,7 @@
### Instructions
Écrire une fonction qui applique une fonction en ordre (in order) a chaque élément de l'arbre.
(voir les `in order tree walks`)
Écrire une fonction qui applique une fonction en ordre (in order) à chaque élément de l'arbre (voir les "in order tree walks").
### Fonction attendue

2
subjects/btreeapplypostorder.fr.md

@ -2,7 +2,7 @@
### Instructions
Écrire une fonction qui applique une fonction en post-ordre (`postorder walk`) à chaque élément de l'arbre.
Écrire une fonction qui applique une fonction en post-ordre ("postorder walk") à chaque élément de l'arbre.
### Fonction attendue

2
subjects/btreeapplypreorder.fr.md

@ -2,7 +2,7 @@
### Instructions
Écrire une fonction qui applique une fonction en pré-ordre (`preorder walk`) a chaque élément de l'arbre.
Écrire une fonction qui applique une fonction en pré-ordre ("preorder walk") à chaque élément de l'arbre.
### Fonction attendue

7
subjects/btreedeletenode.en.md

@ -12,7 +12,6 @@ The resulting tree should still follow the binary search tree rules.
func BTreeDeleteNode(root, node *TreeNode) *TreeNode {
}
```
### Usage
@ -44,8 +43,8 @@ func main() {
And its output :
```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
Before delete:
1
4
@ -55,5 +54,5 @@ After delete:
1
5
7
student@ubuntu:~/student/test$
student@ubuntu:~/piscine-go/test$
```

7
subjects/btreedeletenode.fr.md

@ -12,7 +12,6 @@ L'arbre en résultant devra toujours suivre les règles des arbres de recherche
func BTreeDeleteNode(root, node *TreeNode) *TreeNode {
}
```
### Utilisation
@ -44,8 +43,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
Before delete:
1
4
@ -55,5 +54,5 @@ After delete:
1
5
7
student@ubuntu:~/student/test$
student@ubuntu:~/piscine-go/test$
```

4
subjects/btreeinsertdata.en.md

@ -2,8 +2,8 @@
### Instructions
Write a function that inserts new data in a binary search tree
following the properties of binary search trees.
Write a function that inserts new data in a binary search tree following the properties of binary search trees.
The nodes must be defined as follows :
### Expected function

3
subjects/btreeinsertdata.fr.md

@ -2,7 +2,8 @@
### Instructions
Écrire une fonction qui insère de la nouvelle data dans un arbre binaire en suivant les propriétés des arbres de recherche binaires.
Écrire une fonction qui insère de la nouvelle donnée dans un arbre binaire en suivant les propriétés des arbres de recherche binaires.
Les nodes doivent être définies comme ci-dessous :
### Fonction attendue

6
subjects/btreeisbinary.en.md

@ -36,8 +36,8 @@ func main() {
And its output :
```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
true
student@ubuntu:~/student/test$
student@ubuntu:~/piscine-go/test$
```

6
subjects/btreeisbinary.fr.md

@ -36,8 +36,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
true
student@ubuntu:~/student/test$
student@ubuntu:~/piscine-go/test$
```

6
subjects/btreelevelcount.en.md

@ -37,8 +37,8 @@ func main() {
And its output :
```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
3
student@ubuntu:~/student/test$
student@ubuntu:~/piscine-go/test$
```

6
subjects/btreelevelcount.fr.md

@ -37,8 +37,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
3
student@ubuntu:~/student/test$
student@ubuntu:~/piscine-go/test$
```

6
subjects/btreemax.en.md

@ -38,8 +38,8 @@ func main() {
And its output :
```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
7
student@ubuntu:~/student/test$
student@ubuntu:~/piscine-go/test$
```

6
subjects/btreemax.fr.md

@ -38,8 +38,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
7
student@ubuntu:~/student/test$
student@ubuntu:~/piscine-go/test$
```

6
subjects/btreemin.en.md

@ -38,8 +38,8 @@ func main() {
And its output :
```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
1
student@ubuntu:~/student/test$
student@ubuntu:~/piscine-go/test$
```

6
subjects/btreemin.fr.md

@ -38,8 +38,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
1
student@ubuntu:~/student/test$
student@ubuntu:~/piscine-go/test$
```

6
subjects/btreetransplant.en.md

@ -39,11 +39,11 @@ func main() {
And its output :
```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
3
4
5
7
student@ubuntu:~/student/test$
student@ubuntu:~/piscine-go/test$
```

6
subjects/btreetransplant.fr.md

@ -39,11 +39,11 @@ 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
3
4
5
7
student@ubuntu:~/student/test$
student@ubuntu:~/piscine-go/test$
```

2
subjects/capitalizeprog.fr.md

@ -8,7 +8,7 @@
- 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`").
- Si il n'y a pas d'arguments le programme doit afficher un retour à la ligne (`'\n'`).
### Utilisation :

9
subjects/cat.en.md

@ -23,15 +23,14 @@ Write a program that has the same behaviour as the system's `cat` command-line.
- The program must be submitted inside a folder named `cat`.
```console
student@ubuntu:~/student/cat$ go build
student@ubuntu:~/student/cat$ ./cat
student@ubuntu:~/piscine-go/cat$ go build
student@ubuntu:~/piscine-go/cat$ ./cat
Hello
Hello
student@ubuntu:~/student/cat$ ./cat quest8.txt
student@ubuntu:~/piscine-go/cat$ ./cat quest8.txt
"Programming is a skill best acquired by pratice and example rather than from books" by Alan Turing
student@ubuntu:~/student/cat$ ./cat quest8.txt quest8T.txt
student@ubuntu:~/piscine-go/cat$ ./cat quest8.txt quest8T.txt
"Programming is a skill best acquired by pratice and example rather than from books" by Alan Turing
"Alan Mathison Turing was an English mathematician, computer scientist, logician, cryptanalyst. Turing was highly influential in the development of theoretical computer science, providing a formalisation of the concepts of algorithm and computation with the Turing machine, which can be considered a model of a general-purpose computer. Turing is widely considered to be the father of theoretical computer science and artificial intelligence."
```

9
subjects/cat.fr.md

@ -25,15 +25,14 @@
### Utilisation:
```console
student@ubuntu:~/student/cat$ go build
student@ubuntu:~/student/cat$ ./cat
student@ubuntu:~/piscine-go/cat$ go build
student@ubuntu:~/piscine-go/cat$ ./cat
Hello
Hello
student@ubuntu:~/student/cat$ ./cat quest8.txt
student@ubuntu:~/piscine-go/cat$ ./cat quest8.txt
"Programming is a skill best acquired by pratice and example rather than from books" by Alan Turing
student@ubuntu:~/student/cat$ ./cat quest8.txt quest8T.txt
student@ubuntu:~/piscine-go/cat$ ./cat quest8.txt quest8T.txt
"Programming is a skill best acquired by pratice and example rather than from books" by Alan Turing
"Alan Mathison Turing was an English mathematician, computer scientist, logician, cryptanalyst. Turing was highly influential in the development of theoretical computer science, providing a formalisation of the concepts of algorithm and computation with the Turing machine, which can be considered a model of a general-purpose computer. Turing is widely considered to be the father of theoretical computer science and artificial intelligence."
```

2
subjects/comcheck.en.md

@ -2,7 +2,7 @@
### Instructions
Write a program `comcheck` that displays on the standard output `Alert!!!` followed by newline(`'\n'`) if at least one of the arguments passed in parameter matches the `strings`:
Write a program `comcheck` that displays on the standard output `Alert!!!` followed by newline (`'\n'`) if at least one of the arguments passed in parameter matches the `string`:
- `01`, `galaxy` or `galaxy 01`.

4
subjects/comcheck.fr.md

@ -2,11 +2,11 @@
### Instructions
écrire un programme `comcheck` qui affiche sur la sortie standard `Alert!!!` suivi d'un newline(`'\n'`) si au moins un des arguments passé ne paramètre correspond aux `strings`:
écrire un programme `comcheck` qui affiche sur la sortie standard `Alert!!!` suivi d'un retour à la ligne (`'\n'`) si au moins un des arguments passé ne paramètre correspond aux `string`:
- `01`, `galaxy` ou `galaxy 01`.
- si aucun des paramètres correspond, le programme affiche un newline(`'\n'`).
- si aucun des paramètres correspond, le programme affiche un retour à la ligne (`'\n'`).
### Usage

2
subjects/compact.fr.md

@ -2,7 +2,7 @@
### Instructions
Écrire une fonction `Compact` qui prend un pointeur sur slice de `strings` comme paramètre.
Écrire une fonction `Compact` qui prend un pointeur sur slice de `string` comme paramètre.
Cette fonction doit:
- Retourner le nombre d'éléments avec des valeurs non-`nil`

2
subjects/compareprog.en.md

@ -4,7 +4,7 @@
Write a program that behaves like the `Compare` function.
This program prints a number after comparing two `strings` lexicographically.
This program prints a number after comparing two `string` lexicographically.
### Usage :

2
subjects/compareprog.fr.md

@ -4,7 +4,7 @@
Écrire un programme qui se comporte comme la fonction `Compare`.
Ce programme affiche un nombre après avoir comparé deux `strings` lexicalement.
Ce programme affiche un nombre après avoir comparé deux `string` lexicalement.
### Utilisation :

1
subjects/concatparams.fr.md

@ -10,6 +10,7 @@ Les arguments doivent être **séparés** par un `\n`.
```go
func ConcatParams(args []string) string {
}
```

1
subjects/convertbase.en.md

@ -12,6 +12,7 @@ Negative numbers will not be tested.
```go
func ConvertBase(nbr, baseFrom, baseTo string) string {
}
```

1
subjects/convertbase.fr.md

@ -12,6 +12,7 @@ Les nombres négatifs ne seront pas testés.
```go
func ConvertBase(nbr, baseFrom, baseTo string) string {
}
```

3
subjects/countdown.en.md

@ -2,8 +2,7 @@
### Instructions
Write a program that displays all digits in descending order, followed by a
newline(`'\n'`).
Write a program that displays all digits in descending order, followed by a newline (`'\n'`).
### Usage

2
subjects/countdown.fr.md

@ -2,7 +2,7 @@
### Instructions
Écrire un programme qui affiche les chiffres dans l'ordre décroissant sur une seule ligne, suivi par un newline(`'\n'`).
Écrire un programme qui affiche les chiffres dans l'ordre décroissant sur une seule ligne, suivi par un retour à la ligne (`'\n'`).
### Utilisation

1
subjects/countif.en.md

@ -8,6 +8,7 @@ Write a function `CountIf` that returns the number of elements of a `string` arr
```go
func CountIf(f func(string) bool, tab []string) int {
}
```

1
subjects/countif.fr.md

@ -8,6 +8,7 @@
```go
func CountIf(f func(string) bool, tab []string) int {
}
```

2
subjects/displaya.fr.md

@ -2,7 +2,7 @@
### Instructions
Écrire un programme qui prend une `string`, et qui affiche le premier caractère `a` qu'il trouve dedans, suivi par un newline(`'\n'`). Si il n'y a pas de caractère `a` dans la `string`, le programme affiche juste un `a` suivi d'un newline(`'\n'`). Si le nombre de paramètres n'est pas 1, le programme affiche un `a` suivi d'un newline(`'\n'`).
Écrire un programme qui prend une `string`, et qui affiche le premier caractère `a` qu'il trouve dedans, suivi par un retour à la ligne (`'\n'`). Si il n'y a pas de caractère `a` dans la `string`, le programme affiche juste un `a` suivi d'un retour à la ligne (`'\n'`). Si le nombre de paramètres n'est pas 1, le programme affiche un `a` suivi d'un retour à la ligne (`'\n'`).
### Utilisation

6
subjects/displayalpham.en.md

@ -8,8 +8,8 @@ odd letters in lowercase, followed by a newline(`'\n'`).
### Usage
```console
student@ubuntu:~/student/displayalpham$ go build
student@ubuntu:~/student/displayalpham$ ./displayalpham | cat -e
student@ubuntu:~/piscine-go/displayalpham$ go build
student@ubuntu:~/piscine-go/displayalpham$ ./displayalpham | cat -e
aBcDeFgHiJkLmNoPqRsTuVwXyZ$
student@ubuntu:~/student/displayalpham$
student@ubuntu:~/piscine-go/displayalpham$
```

8
subjects/displayalpham.fr.md

@ -2,13 +2,13 @@
### Instructions
Écrire un programme qui affiche l'alphabet, avec les lettres paires en majuscule, et les lettres impaires en minuscule, suivi d'un newline(`'\n'`).
Écrire un programme qui affiche l'alphabet, avec les lettres paires en majuscule, et les lettres impaires en minuscule, suivi d'un retour à la ligne (`'\n'`).
### Utilisation
```console
student@ubuntu:~/student/displayalpham$ go build
student@ubuntu:~/student/displayalpham$ ./displayalpham | cat -e
student@ubuntu:~/piscine-go/displayalpham$ go build
student@ubuntu:~/piscine-go/displayalpham$ ./displayalpham | cat -e
aBcDeFgHiJkLmNoPqRsTuVwXyZ$
student@ubuntu:~/student/displayalpham$
student@ubuntu:~/piscine-go/displayalpham$
```

6
subjects/displayalrevm.en.md

@ -8,8 +8,8 @@ uppercase, and odd letters in lowercase, followed by a newline(`'\n'`).
### Usage
```console
student@ubuntu:~/student/displayalrevm$ go build
student@ubuntu:~/student/displayalrevm$ ./displayalrevm | cat -e
student@ubuntu:~/piscine-go/displayalrevm$ go build
student@ubuntu:~/piscine-go/displayalrevm$ ./displayalrevm | cat -e
zYxWvUtSrQpOnMlKjIhGfEdCbA$
student@ubuntu:~/student/displayalrevm$
student@ubuntu:~/piscine-go/displayalrevm$
```

8
subjects/displayalrevm.fr.md

@ -2,13 +2,13 @@
### Instructions
Écrire un programme qui affiche l'alphabet à l'envers, avec les lettres paires en majuscule, et les lettres impaires en minuscule, suivi d'un newline(`'\n'`).
Écrire un programme qui affiche l'alphabet à l'envers, avec les lettres paires en majuscule, et les lettres impaires en minuscule, suivi d'un retour à la ligne (`'\n'`).
### Utilisation
```console
student@ubuntu:~/student/displayalrevm$ go build
student@ubuntu:~/student/displayalrevm$ ./displayalrevm | cat -e
student@ubuntu:~/piscine-go/displayalrevm$ go build
student@ubuntu:~/piscine-go/displayalrevm$ ./displayalrevm | cat -e
zYxWvUtSrQpOnMlKjIhGfEdCbA$
student@ubuntu:~/student/displayalrevm$
student@ubuntu:~/piscine-go/displayalrevm$
```

8
subjects/displayfile.en.md

@ -15,11 +15,11 @@ Write a program that displays, on the standard output, the content of a file giv
### Usage :
```console
student@ubuntu:~/student/displayfile$ go build
student@ubuntu:~/student/displayfile$ ./displayfile
student@ubuntu:~/piscine-go/displayfile$ go build
student@ubuntu:~/piscine-go/displayfile$ ./displayfile
File name missing
student@ubuntu:~/student/displayfile$ ./displayfile quest8.txt main.go
student@ubuntu:~/piscine-go/displayfile$ ./displayfile quest8.txt main.go
Too many arguments
student@ubuntu:~/student/displayfile$ ./displayfile quest8.txt
student@ubuntu:~/piscine-go/displayfile$ ./displayfile quest8.txt
Almost there!!
```

8
subjects/displayfile.fr.md

@ -15,11 +15,11 @@
### Utilisation:
```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
File name missing
student@ubuntu:~/student/test$ ./test quest8.txt main.go
student@ubuntu:~/piscine-go/test$ ./test quest8.txt main.go
Too many arguments
student@ubuntu:~/student/test$ ./test quest8.txt
student@ubuntu:~/piscine-go/test$ ./test quest8.txt
Almost there!!
```

2
subjects/displayfirstparam.en.md

@ -2,7 +2,7 @@
### Instructions
Write a program that takes `strings` as arguments, and displays its first argument.
Write a program that takes `string` as arguments, and displays its first argument.
### Usage

2
subjects/displayfirstparam.fr.md

@ -2,7 +2,7 @@
### Instructions
Écrire un programme qui prend des `strings` comme arguments, et qui affiche le premier argument.
Écrire un programme qui prend des `string` comme arguments, et qui affiche le premier argument.
### Utilisation

2
subjects/displaylastparam.en.md

@ -2,7 +2,7 @@
### Instructions
Write a program that takes `strings` as arguments, and displays its last argument.
Write a program that takes `string` as arguments, and displays its last argument.
### Expected output

2
subjects/displaylastparam.fr.md

@ -2,7 +2,7 @@
### Instructions
Écrire un programme qui prend des `strings` comme arguments, et qui affiche le dernier argument.
Écrire un programme qui prend des `string` comme arguments, et qui affiche le dernier argument.
### Expected output

5
subjects/displayz.en.md

@ -2,10 +2,7 @@
### Instructions
Write a program that takes a `string`, and displays the first `z` character it
encounters in it, followed by a newline(`'\n'`). If there are no `z` characters in the
string, the program just writes `z` followed by a newline(`'\n'`). If the number of parameters is not
1, the program displays an `z` followed by a newline(`'\n'`).
Write a program that takes a `string`, and displays the first `z` character it encounters in it, followed by a newline (`'\n'`). If there are no `z` characters in the string, the program just writes `z` followed by a newline (`'\n'`). If the number of parameters is not 1, the program displays an `z` followed by a newline (`'\n'`).
### Usage

2
subjects/displayz.fr.md

@ -2,7 +2,7 @@
### Instructions
Écrire un programme qui prend une `string`, et qui affiche le premier caractère `z` qu'il trouve dedans, suivi par un newline(`'\n'`). Si il n'y a pas de caractère `z` dans la `string`, le programme affiche juste un `z` suivi d'un newline(`'\n'`). Si le nombre de paramètres n'est pas 1, le programme affiche un `z` suivi d'un newline(`'\n'`).
Écrire un programme qui prend une `string`, et qui affiche le premier caractère `z` qu'il trouve dedans, suivi par un retour à la ligne (`'\n'`). Si il n'y a pas de caractère `z` dans la `string`, le programme affiche juste un `z` suivi d'un retour à la ligne (`'\n'`). Si le nombre de paramètres n'est pas 1, le programme affiche un `z` suivi d'un retour à la ligne (`'\n'`).
### Utilisation

Some files were not shown because too many files changed in this diff diff.show_more

Loading…
Cancel
Save