Compare commits

..

3 Commits

Author SHA1 Message Date
estlop 124d3ad576 docs: Explain what to do when slice is empty or there are no even elements as per review 2 years ago
estlop 63f648c8d9 docs: fix wrong syntax on usage 2 years ago
estlop 158ca1e7c0 docs: Add readme file for evenlength subject 2 years ago
  1. 33
      subjects/evenlength/README.md
  2. 25
      subjects/getarea/README.md
  3. 9
      subjects/ultimatedivmod/README.md

33
subjects/evenlength/README.md

@ -0,0 +1,33 @@
## evenlength
### Instructions
Write a function that receives a slice of strings and returns a new slice with the strings in which the length is even. When the slice is empty or there are no even strings return an empty slice.
### Expected function
```go
func EvenLength(strings []string) []string {
}
```
### Usage
Here is a possible program to test your function:
```go
package main
import "fmt"
func main() {
fmt.Println(EvenLength([]string{"Hi", "Hola", "Ola", "Ciao", "Salut", "Hallo"}))
}
```
And its output:
```console
$ go run .
[Hi Hola Ciao]
```

25
subjects/getarea/README.md

@ -1,25 +0,0 @@
## get-area
### Instructions
Write a program that takes a positive number as radius and prints the area of a circle.
- The area of the circle is `3.14` times the radius squared.
- Only positive numbers will be accepted, otherwise print `Error` followed by (`'\n'`)
- If the number of arguments is not `1` print (`'\n'`)
- The output must be an integer.
### Usage
```console
$ go run . | cat -e
$
$ go run . 10 | cat -e
314$
$ go run . 4 | cat -e
50$
$ go run . -10 | cat -e
Error$
$ go run . "Hello World!" | cat -e
Error$
```

9
subjects/ultimatedivmod/README.md

@ -2,7 +2,7 @@
### Instructions
Create the following function.
- Write a function that will be formatted as below.
### Expected function
@ -11,9 +11,10 @@ func UltimateDivMod(a *int, b *int) {
}
```
`UltimateDivMod` should divide the dereferenced value of `a` by the dereferenced value of `b`.
- Store the result of the division in the `int` which `a` points to.
- Store the remainder of the division in the `int` which `b` points to.
- This function will divide the `int` **a** and **b**.
- The result of this division will be stored in the `int` pointed by **a**.
- The remainder of this division will be stored in the `int` pointed by **b**.
### Usage

Loading…
Cancel
Save