mirror of https://github.com/01-edu/public.git
docs(rockandroll): upgrade instructions
This commit is contained in:
parent
f6d0cc58a7
commit
27ef0d2782
|
@ -7,6 +7,8 @@ Write a function called `RockAndRoll()` that takes an `int` and returns a `strin
|
||||||
- If the number is divisible by 2, print `rock` followed by a newline `\n`.
|
- If the number is divisible by 2, print `rock` followed by a newline `\n`.
|
||||||
- If the number is divisible by 3, print `roll` followed by a newline `\n`.
|
- If the number is divisible by 3, print `roll` followed by a newline `\n`.
|
||||||
- If the number is divisible by 2 and 3, print `rock and roll` followed by a newline `\n`.
|
- If the number is divisible by 2 and 3, print `rock and roll` followed by a newline `\n`.
|
||||||
|
- If the number is negative return `error: number is negative` followed by a newline `\n`.
|
||||||
|
- If the number is non divisible return `error: non divisible` followed by a newline `\n`.
|
||||||
|
|
||||||
### Expected function
|
### Expected function
|
||||||
|
|
||||||
|
@ -23,14 +25,14 @@ Here is a possible program to test your function:
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"piscine"
|
"piscine"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
fmt.Println(piscine.RockAndRoll(4))
|
fmt.Println(piscine.RockAndRoll(4))
|
||||||
fmt.Println(piscine.RockAndRoll(9))
|
fmt.Println(piscine.RockAndRoll(9))
|
||||||
fmt.Println(piscine.RockAndRoll(6))
|
fmt.Println(piscine.RockAndRoll(6))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
And its output:
|
And its output:
|
||||||
|
|
Loading…
Reference in New Issue