From c19ca6ae63d4ab4e2ba5b6288e64fda8edb45d8b Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 3 Oct 2019 10:59:55 +0100 Subject: [PATCH] atoibase readme for the exams nad a correction of the doop readme --- subjects/atoibaseprog.en.md | 38 +++++++++++++++++++++++++++++++++++++ subjects/doop.en.md | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 subjects/atoibaseprog.en.md diff --git a/subjects/atoibaseprog.en.md b/subjects/atoibaseprog.en.md new file mode 100644 index 00000000..4022d16f --- /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 1e55cfd8..5b74f28b 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 ```