Browse Source

adaptation of fr subject

pull/292/head
Christopher Fremond 5 years ago committed by Christopher Fremond
parent
commit
a230bc1449
  1. 14
      subjects/reversebits.en.md
  2. 36
      subjects/reversebits.fr.md

14
subjects/reversebits.en.md

@ -2,8 +2,8 @@
### Instructions
Write a program that takes a `byte` in binary format and that reverses it `bit` by `bit` (like the
example)
Write a program that takes a `byte` in binary format, that reverses it `bit` by `bit` (as shown in the
example) and that prints the result.
### Expected output
@ -11,11 +11,11 @@ example)
student@ubuntu:~/piscine-go/reversebits$ go build
student@ubuntu:~/piscine-go/reversebits$ ./reversebits
Not enough arguments.
student@ubuntu:~/piscine-go/reversebits$ ./reversebits 00100110
01100100
student@ubuntu:~/piscine-go/reversebits$ ./reversebits 00100110 | cat -e
01100100$
student@ubuntu:~/piscine-go/reversebits$ ./reversebits "djs"
The argument "djs" doesn't represent a byte
student@ubuntu:~/piscine-go/reversebits$ ./reversebits "0102039s"
The argument "0102039s" doesn't represent a byte
The argument "djs" does not represent a byte
student@ubuntu:~/piscine-go/reversebits$ ./reversebits "0102039s" | cat -e
The argument "0102039s" does not represent a byte$
student@ubuntu:~/piscine-go/reversebits$
```

36
subjects/reversebits.fr.md

@ -2,25 +2,19 @@
### Instructions
É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
```go
func ReverseBits(octet byte) byte {
}
```
Exemple:
1 byte
---
```
00100110
||
\/
01100100
Écrire un programme qui prend un `byte`, qui l'inverse `bit` par `bit` (comme montré sur l'exemple) et qui affiche le résultat.
### Utilisation
```console
student@ubuntu:~/piscine-go/reversebits$ go build
student@ubuntu:~/piscine-go/reversebits$ ./reversebits
Not enough arguments.
student@ubuntu:~/piscine-go/reversebits$ ./reversebits 00100110 | cat -e
01100100$
student@ubuntu:~/piscine-go/reversebits$ ./reversebits "djs"
The argument "djs" does not represent a byte
student@ubuntu:~/piscine-go/reversebits$ ./reversebits "0102039s" | cat -e
The argument "0102039s" does not represent a byte$
student@ubuntu:~/piscine-go/reversebits$
```

Loading…
Cancel
Save