From 907fcfa3aec1dc0dde07c5e255e1348fb2f6b46b Mon Sep 17 00:00:00 2001 From: lee Date: Mon, 7 Jun 2021 18:05:53 +0100 Subject: [PATCH] test and resources check quest 05 --- subjects/alphacount/README.md | 3 ++- subjects/atoibase/README.md | 2 +- subjects/basicjoin/README.md | 4 ++++ subjects/capitalize/README.md | 2 +- subjects/compare/README.md | 6 +++++- subjects/firstrune/README.md | 4 ++++ subjects/index/README.md | 6 +++++- subjects/isalpha/README.md | 2 +- subjects/isnumeric/README.md | 2 +- subjects/isprintable/README.md | 2 +- subjects/join/README.md | 6 +++++- subjects/lastrune/README.md | 4 ++++ subjects/nrune/README.md | 4 ++++ subjects/printnbrbase/README.md | 6 +++++- subjects/printnbrinorder/README.md | 5 +++++ subjects/tolower/README.md | 6 +++++- subjects/toupper/README.md | 6 +++++- subjects/trimatoi/README.md | 10 ++++++---- 18 files changed, 64 insertions(+), 16 deletions(-) diff --git a/subjects/alphacount/README.md b/subjects/alphacount/README.md index 8917de36..9cafb0ec 100644 --- a/subjects/alphacount/README.md +++ b/subjects/alphacount/README.md @@ -3,7 +3,8 @@ ### Instructions Write a function that counts only the letters of a `string` and that returns that count. -White spaces or any other characters should not be counted. + +- White spaces or any other characters should not be counted. The letters are only the ones from the latin alphabet. diff --git a/subjects/atoibase/README.md b/subjects/atoibase/README.md index bbd6b574..c1ecbd73 100644 --- a/subjects/atoibase/README.md +++ b/subjects/atoibase/README.md @@ -2,7 +2,7 @@ ### Instructions -Write a function that takes a `string` number and its `string` base in parameters and returns its conversion as an `int`. +Write a function that takes a `string` number and its `string` base as parameters and returns its conversion as an `int`. If the base is not valid it returns `0`. diff --git a/subjects/basicjoin/README.md b/subjects/basicjoin/README.md index d9cdd8e1..66eaa5a9 100644 --- a/subjects/basicjoin/README.md +++ b/subjects/basicjoin/README.md @@ -37,3 +37,7 @@ $ go run . Hello! How are you? $ ``` + +### Notions + +- [string concatenation](https://golang.org/ref/spec#Arithmetic_operators) diff --git a/subjects/capitalize/README.md b/subjects/capitalize/README.md index cd986b16..310fa1a4 100644 --- a/subjects/capitalize/README.md +++ b/subjects/capitalize/README.md @@ -2,7 +2,7 @@ ### Instructions -Write a function that capitalizes the first letter of each word **and** lowercases the rest of each word of a `string`. +Write a function that capitalizes the first letter of each word **and** lowercases the rest. A word is a sequence of **alphanumerical** characters. diff --git a/subjects/compare/README.md b/subjects/compare/README.md index 0bbf0d70..170e00a7 100644 --- a/subjects/compare/README.md +++ b/subjects/compare/README.md @@ -2,7 +2,7 @@ ### Instructions -Write a function that behaves like the [`Compare`](https://golang.org/pkg/strings/#Compare) function. +Write a function that behaves like the `Compare` function. ### Expected function @@ -40,3 +40,7 @@ $ go run . 1 $ ``` + +### Notions + +- [strings/Compare](https://golang.org/pkg/strings/#Compare) diff --git a/subjects/firstrune/README.md b/subjects/firstrune/README.md index d507cf36..8691eb2b 100644 --- a/subjects/firstrune/README.md +++ b/subjects/firstrune/README.md @@ -40,3 +40,7 @@ $ go run . HSO $ ``` + +### Notions + +- [rune-literals](https://golang.org/ref/spec#Rune_literals) diff --git a/subjects/index/README.md b/subjects/index/README.md index 6e4c7490..9a2f9ab0 100644 --- a/subjects/index/README.md +++ b/subjects/index/README.md @@ -2,7 +2,7 @@ ### Instructions -Write a function that behaves like the [`Index`](https://golang.org/pkg/strings/#Index) function. +Write a function that behaves like the `Index` function. ### Expected function @@ -40,3 +40,7 @@ $ go run . -1 $ ``` + +### Notions + +- [strings/Index](https://golang.org/pkg/strings/#Index) diff --git a/subjects/isalpha/README.md b/subjects/isalpha/README.md index b51440e2..87e537ac 100644 --- a/subjects/isalpha/README.md +++ b/subjects/isalpha/README.md @@ -2,7 +2,7 @@ ### Instructions -Write a function that returns `true` if the `string` passed in parameter only contains alphanumerical characters or is empty, and that returns `false` otherwise. +Write a function that returns `true` if the `string` passed in parameter only contains alphanumerical characters or is empty, and returns `false` otherwise. ### Expected function diff --git a/subjects/isnumeric/README.md b/subjects/isnumeric/README.md index 68e2fc1d..bd313747 100644 --- a/subjects/isnumeric/README.md +++ b/subjects/isnumeric/README.md @@ -2,7 +2,7 @@ ### Instructions -Write a function that returns `true` if the `string` passed in parameter only contains numerical characters, and that returns `false` otherwise. +Write a function that returns `true` if the `string` passed in parameter only contains numerical characters, and returns `false` otherwise. ### Expected function diff --git a/subjects/isprintable/README.md b/subjects/isprintable/README.md index d2153612..fa22fb5f 100644 --- a/subjects/isprintable/README.md +++ b/subjects/isprintable/README.md @@ -2,7 +2,7 @@ ### Instructions -Write a function that returns `true` if the `string` passed in parameter only contains printable characters, and that returns `false` otherwise. +Write a function that returns `true` if the `string` passed in parameter only contains printable characters, and returns `false` otherwise. ### Expected function diff --git a/subjects/join/README.md b/subjects/join/README.md index 94f33117..fdf73457 100644 --- a/subjects/join/README.md +++ b/subjects/join/README.md @@ -2,7 +2,7 @@ ### Instructions -Write a function that returns the concatenation of all the `string` of a slice of `string` **separated** by the separator passed in argument. +Write a function that simulates the behaviour of the `Join` function in Go. This function returns the concatenation of all the strings of a slice of strings **separated** by a separator passed in argument. ### Expected function @@ -37,3 +37,7 @@ $ go run . Hello!: How: are: you? $ ``` + +### Notions + +- [strings/Join](https://golang.org/pkg/strings/#Join) diff --git a/subjects/lastrune/README.md b/subjects/lastrune/README.md index cbee3103..1ac71f9b 100644 --- a/subjects/lastrune/README.md +++ b/subjects/lastrune/README.md @@ -40,3 +40,7 @@ $ go run . !!! $ ``` + +### Notions + +- [rune-literals](https://golang.org/ref/spec#Rune_literals) diff --git a/subjects/nrune/README.md b/subjects/nrune/README.md index d35b372b..ebf44a29 100644 --- a/subjects/nrune/README.md +++ b/subjects/nrune/README.md @@ -44,3 +44,7 @@ $ go run . la! $ ``` + +### Notions + +- [rune-literals](https://golang.org/ref/spec#Rune_literals) diff --git a/subjects/printnbrbase/README.md b/subjects/printnbrbase/README.md index 5464f7dd..81d786f4 100644 --- a/subjects/printnbrbase/README.md +++ b/subjects/printnbrbase/README.md @@ -2,7 +2,7 @@ ### Instructions -Write a function that prints an `int` in a `string` base passed in parameters. +Write a function that prints an `int` in a `string` base passed as parameters. If the base is not valid, the function prints `NV` (Not Valid): @@ -62,3 +62,7 @@ $ go run . NV $ ``` + +### Notions + +- [01-edu/z01](https://github.com/01-edu/z01) diff --git a/subjects/printnbrinorder/README.md b/subjects/printnbrinorder/README.md index 2d1ff43a..d634dea0 100644 --- a/subjects/printnbrinorder/README.md +++ b/subjects/printnbrinorder/README.md @@ -37,3 +37,8 @@ $ go run . | cat -e 1230123$ $ ``` + +### Notions + +- [01-edu/z01](https://github.com/01-edu/z01) +- [rune-literals](https://golang.org/ref/spec#Rune_literals) diff --git a/subjects/tolower/README.md b/subjects/tolower/README.md index 24057a17..7c825a7d 100644 --- a/subjects/tolower/README.md +++ b/subjects/tolower/README.md @@ -2,7 +2,7 @@ ### Instructions -Write a function that lowercases each letter of `string`. +Write a function that lower cases each letter of a `string`. ### Expected function @@ -36,3 +36,7 @@ $ go run . hello! how are you? $ ``` + +### Notions + +- [strings/ToLower](https://golang.org/pkg/strings/#ToLower) diff --git a/subjects/toupper/README.md b/subjects/toupper/README.md index 8b145dcd..2f2331d5 100644 --- a/subjects/toupper/README.md +++ b/subjects/toupper/README.md @@ -2,7 +2,7 @@ ### Instructions -Write a function that capitalizes each letter of `string`. +Write a function that capitalizes each letter of a `string`. ### Expected function @@ -36,3 +36,7 @@ $ go run . HELLO! HOW ARE YOU? $ ``` + +### Notions + +- [strings/ToUpper](https://golang.org/pkg/strings/#ToUpper) diff --git a/subjects/trimatoi/README.md b/subjects/trimatoi/README.md index 2d9c27ed..4bcbba40 100644 --- a/subjects/trimatoi/README.md +++ b/subjects/trimatoi/README.md @@ -2,13 +2,13 @@ ### Instructions -- Write a function that transforms a number within a `string` in a number represented as an `int`. +- Write a function that transforms a number within a `string`, in a number represented as an `int`. -- For this exercise the handling of the signs + or - **has** to be taken into account. If one of the signs is encountered before any number it should determine the sign of the returned `int`. +- For this exercise the handling of the sign `-` **has** to be taken into account. If the sign is encountered before any number it should determine the sign of the returned `int`. -- This function will **only** have to return the `int`. In case of invalid input, the function should return `0`. +- This function will **only** return an `int`. In case of invalid input, the function should return `0`. -- Note: There will never be more than one sign by string in the tests. +- **Note**: There will never be more than one sign by `string` in the tests. ### Expected function @@ -38,6 +38,7 @@ func main() { fmt.Println(piscine.TrimAtoi("sd+x1fa2W3s4")) fmt.Println(piscine.TrimAtoi("sd-x1fa2W3s4")) fmt.Println(piscine.TrimAtoi("sdx1-fa2W3s4")) + fmt.Println(piscine.TrimAtoi("sdx1+fa2W3s4")) } ``` @@ -52,5 +53,6 @@ $ go run . 1234 -1234 1234 +1234 $ ```