Browse Source

test and resources check quest 05

pull/787/head
lee 3 years ago
parent
commit
907fcfa3ae
  1. 3
      subjects/alphacount/README.md
  2. 2
      subjects/atoibase/README.md
  3. 4
      subjects/basicjoin/README.md
  4. 2
      subjects/capitalize/README.md
  5. 6
      subjects/compare/README.md
  6. 4
      subjects/firstrune/README.md
  7. 6
      subjects/index/README.md
  8. 2
      subjects/isalpha/README.md
  9. 2
      subjects/isnumeric/README.md
  10. 2
      subjects/isprintable/README.md
  11. 6
      subjects/join/README.md
  12. 4
      subjects/lastrune/README.md
  13. 4
      subjects/nrune/README.md
  14. 6
      subjects/printnbrbase/README.md
  15. 5
      subjects/printnbrinorder/README.md
  16. 6
      subjects/tolower/README.md
  17. 6
      subjects/toupper/README.md
  18. 10
      subjects/trimatoi/README.md

3
subjects/alphacount/README.md

@ -3,7 +3,8 @@
### Instructions ### Instructions
Write a function that counts only the letters of a `string` and that returns that count. 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. The letters are only the ones from the latin alphabet.

2
subjects/atoibase/README.md

@ -2,7 +2,7 @@
### Instructions ### 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`. If the base is not valid it returns `0`.

4
subjects/basicjoin/README.md

@ -37,3 +37,7 @@ $ go run .
Hello! How are you? Hello! How are you?
$ $
``` ```
### Notions
- [string concatenation](https://golang.org/ref/spec#Arithmetic_operators)

2
subjects/capitalize/README.md

@ -2,7 +2,7 @@
### Instructions ### 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. A word is a sequence of **alphanumerical** characters.

6
subjects/compare/README.md

@ -2,7 +2,7 @@
### Instructions ### 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 ### Expected function
@ -40,3 +40,7 @@ $ go run .
1 1
$ $
``` ```
### Notions
- [strings/Compare](https://golang.org/pkg/strings/#Compare)

4
subjects/firstrune/README.md

@ -40,3 +40,7 @@ $ go run .
HSO HSO
$ $
``` ```
### Notions
- [rune-literals](https://golang.org/ref/spec#Rune_literals)

6
subjects/index/README.md

@ -2,7 +2,7 @@
### Instructions ### 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 ### Expected function
@ -40,3 +40,7 @@ $ go run .
-1 -1
$ $
``` ```
### Notions
- [strings/Index](https://golang.org/pkg/strings/#Index)

2
subjects/isalpha/README.md

@ -2,7 +2,7 @@
### Instructions ### 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 ### Expected function

2
subjects/isnumeric/README.md

@ -2,7 +2,7 @@
### Instructions ### 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 ### Expected function

2
subjects/isprintable/README.md

@ -2,7 +2,7 @@
### Instructions ### 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 ### Expected function

6
subjects/join/README.md

@ -2,7 +2,7 @@
### Instructions ### 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 ### Expected function
@ -37,3 +37,7 @@ $ go run .
Hello!: How: are: you? Hello!: How: are: you?
$ $
``` ```
### Notions
- [strings/Join](https://golang.org/pkg/strings/#Join)

4
subjects/lastrune/README.md

@ -40,3 +40,7 @@ $ go run .
!!! !!!
$ $
``` ```
### Notions
- [rune-literals](https://golang.org/ref/spec#Rune_literals)

4
subjects/nrune/README.md

@ -44,3 +44,7 @@ $ go run .
la! la!
$ $
``` ```
### Notions
- [rune-literals](https://golang.org/ref/spec#Rune_literals)

6
subjects/printnbrbase/README.md

@ -2,7 +2,7 @@
### Instructions ### 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): If the base is not valid, the function prints `NV` (Not Valid):
@ -62,3 +62,7 @@ $ go run .
NV NV
$ $
``` ```
### Notions
- [01-edu/z01](https://github.com/01-edu/z01)

5
subjects/printnbrinorder/README.md

@ -37,3 +37,8 @@ $ go run . | cat -e
1230123$ 1230123$
$ $
``` ```
### Notions
- [01-edu/z01](https://github.com/01-edu/z01)
- [rune-literals](https://golang.org/ref/spec#Rune_literals)

6
subjects/tolower/README.md

@ -2,7 +2,7 @@
### Instructions ### Instructions
Write a function that lowercases each letter of `string`. Write a function that lower cases each letter of a `string`.
### Expected function ### Expected function
@ -36,3 +36,7 @@ $ go run .
hello! how are you? hello! how are you?
$ $
``` ```
### Notions
- [strings/ToLower](https://golang.org/pkg/strings/#ToLower)

6
subjects/toupper/README.md

@ -2,7 +2,7 @@
### Instructions ### Instructions
Write a function that capitalizes each letter of `string`. Write a function that capitalizes each letter of a `string`.
### Expected function ### Expected function
@ -36,3 +36,7 @@ $ go run .
HELLO! HOW ARE YOU? HELLO! HOW ARE YOU?
$ $
``` ```
### Notions
- [strings/ToUpper](https://golang.org/pkg/strings/#ToUpper)

10
subjects/trimatoi/README.md

@ -2,13 +2,13 @@
### Instructions ### 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 ### Expected function
@ -38,6 +38,7 @@ func main() {
fmt.Println(piscine.TrimAtoi("sd+x1fa2W3s4")) fmt.Println(piscine.TrimAtoi("sd+x1fa2W3s4"))
fmt.Println(piscine.TrimAtoi("sd-x1fa2W3s4")) fmt.Println(piscine.TrimAtoi("sd-x1fa2W3s4"))
fmt.Println(piscine.TrimAtoi("sdx1-fa2W3s4")) fmt.Println(piscine.TrimAtoi("sdx1-fa2W3s4"))
fmt.Println(piscine.TrimAtoi("sdx1+fa2W3s4"))
} }
``` ```
@ -52,5 +53,6 @@ $ go run .
1234 1234
-1234 -1234
1234 1234
1234
$ $
``` ```

Loading…
Cancel
Save