mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
1.4 KiB
112 lines
1.4 KiB
5 years ago
|
## raid1d
|
||
|
|
||
|
### Instructions
|
||
|
|
||
![]()
5 years ago
|
Write a function `Raid1d` that prints a **valid** rectangle of width `x` and of height `y`.
|
||
5 years ago
|
|
||
![]()
5 years ago
|
The function must draw the rectangles as in the examples.
|
||
5 years ago
|
|
||
5 years ago
|
`x` and `y` will always be positive numbers. Otherwise, the function should print nothing.
|
||
5 years ago
|
|
||
5 years ago
|
### Expected function
|
||
|
|
||
|
```go
|
||
|
func Raid1d(x,y int) {
|
||
|
|
||
|
}
|
||
|
```
|
||
|
|
||
|
### Usage
|
||
|
|
||
|
Here is are possible programs to test your function :
|
||
|
|
||
|
Program #1
|
||
|
|
||
|
```go
|
||
|
package main
|
||
|
|
||
![]()
4 years ago
|
import piscine ".."
|
||
5 years ago
|
|
||
|
func main() {
|
||
5 years ago
|
piscine.Raid1d(5,3)
|
||
5 years ago
|
}
|
||
|
```
|
||
|
|
||
|
And its output :
|
||
|
|
||
|
```console
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$ go build
|
||
|
student@ubuntu:~/[[ROOT]]/test$ ./test
|
||
5 years ago
|
ABBBC
|
||
|
B B
|
||
|
ABBBC
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$
|
||
5 years ago
|
```
|
||
|
|
||
|
Program #2
|
||
|
|
||
|
```go
|
||
|
package main
|
||
|
|
||
![]()
4 years ago
|
import piscine ".."
|
||
5 years ago
|
|
||
|
func main() {
|
||
5 years ago
|
piscine.Raid1d(5,1)
|
||
5 years ago
|
}
|
||
|
```
|
||
|
|
||
|
And its output :
|
||
|
|
||
|
```console
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$ go build
|
||
|
student@ubuntu:~/[[ROOT]]/test$ ./test
|
||
5 years ago
|
ABBBC
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$
|
||
5 years ago
|
```
|
||
|
|
||
|
Program #3
|
||
|
|
||
|
```go
|
||
|
package main
|
||
|
|
||
![]()
4 years ago
|
import piscine ".."
|
||
5 years ago
|
|
||
|
func main() {
|
||
5 years ago
|
piscine.Raid1d(1,1)
|
||
5 years ago
|
}
|
||
|
```
|
||
|
|
||
|
And its output :
|
||
|
|
||
|
```console
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$ go build
|
||
|
student@ubuntu:~/[[ROOT]]/test$ ./test
|
||
5 years ago
|
A
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$
|
||
5 years ago
|
```
|
||
|
|
||
|
Program #4
|
||
|
|
||
|
```go
|
||
|
package main
|
||
|
|
||
![]()
4 years ago
|
import piscine ".."
|
||
5 years ago
|
|
||
|
func main() {
|
||
5 years ago
|
piscine.Raid1d(1,5)
|
||
5 years ago
|
}
|
||
|
```
|
||
|
|
||
|
And its output :
|
||
|
|
||
|
```console
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$ go build
|
||
|
student@ubuntu:~/[[ROOT]]/test$ ./test
|
||
5 years ago
|
A
|
||
|
B
|
||
|
B
|
||
|
B
|
||
|
A
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$
|
||
5 years ago
|
```
|