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