|
|
@ -2,7 +2,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
### instructions |
|
|
|
### instructions |
|
|
|
|
|
|
|
|
|
|
|
- Write a function named `printRange` that takes a start and end number and prints all the numbers in that range. |
|
|
|
- Write a function named `PrintRange` that takes a start and end number and prints all the numbers in that range. |
|
|
|
- If the start number is greater than the end number, print the numbers in descending order. |
|
|
|
- If the start number is greater than the end number, print the numbers in descending order. |
|
|
|
- If the start number is less than the end number, print the numbers in ascending order. |
|
|
|
- If the start number is less than the end number, print the numbers in ascending order. |
|
|
|
- If the number is greater than `9` print just to `9` |
|
|
|
- If the number is greater than `9` print just to `9` |
|
|
@ -12,7 +12,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
### Function |
|
|
|
### Function |
|
|
|
```go |
|
|
|
```go |
|
|
|
func printRange(start, end int) { |
|
|
|
func PrintRange(start, end int) { |
|
|
|
// Your code here |
|
|
|
// Your code here |
|
|
|
} |
|
|
|
} |
|
|
|
``` |
|
|
|
``` |
|
|
@ -24,12 +24,12 @@ import "piscine" |
|
|
|
import "fmt" |
|
|
|
import "fmt" |
|
|
|
|
|
|
|
|
|
|
|
func main() { |
|
|
|
func main() { |
|
|
|
piscine.printRange(1, 10) |
|
|
|
piscine.PrintRange(1, 10) |
|
|
|
piscine.printRange(10, 1) |
|
|
|
piscine.PrintRange(10, 1) |
|
|
|
piscine.printRange(1, 1) |
|
|
|
piscine.PrintRange(1, 1) |
|
|
|
piscine.printRange(10, 10) |
|
|
|
piscine.PrintRange(10, 10) |
|
|
|
piscine.printRange(0, 9) |
|
|
|
piscine.PrintRange(0, 9) |
|
|
|
piscine.printRange(-1, -10) |
|
|
|
piscine.PrintRange(-1, -10) |
|
|
|
} |
|
|
|
} |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|