diff --git a/subjects/atoibaseprog.en.md b/subjects/atoibaseprog.en.md new file mode 100644 index 000000000..4022d16fc --- /dev/null +++ b/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$ +``` diff --git a/subjects/doop.en.md b/subjects/doop.en.md index 1e55cfd8e..5b74f28b6 100644 --- a/subjects/doop.en.md +++ b/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 ```