Browse Source

atoibase readme for the exams nad a correction of the doop readme

content-update
lee 5 years ago committed by Christopher Fremond
parent
commit
c19ca6ae63
  1. 38
      subjects/atoibaseprog.en.md
  2. 2
      subjects/doop.en.md

38
subjects/atoibaseprog.en.md

@ -0,0 +1,38 @@
## atoibase
### 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
125
student@ubuntu:~/atoibaseprog$ ./atoibaseprog bbbbbab -ab
0
student@ubuntu:~/atoibaseprog$ ./atoibaseprog 1111101
student@ubuntu:~/atoibaseprog$
```

2
subjects/doop.en.md

@ -32,7 +32,7 @@ student@ubuntu:~/piscine-go/test$ ./doop 1 p 1 | cat -e
student@ubuntu:~/piscine-go/test$ ./doop 1 / 0 | cat -e
No division by 0$
student@ubuntu:~/piscine-go/test$ ./doop 1 % 0 | cat -e
No modulo by 0$
No Modulo by 0$
student@ubuntu:~/piscine-go/test$ ./doop 1 "*" 1
1
```

Loading…
Cancel
Save