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
6 years ago
|
## raid1a
|
||
|
|
||
|
### Instructions
|
||
|
|
||
5 years ago
|
Write a function `Raid1a` that prints a **valid** rectangle of width `x` and of height `y`.
|
||
6 years ago
|
|
||
5 years ago
|
The function must draw the rectangles as in the examples.
|
||
6 years ago
|
|
||
5 years ago
|
`x` and `y` will always be positive numbers. Otherwise, the function should print nothing.
|
||
5 years ago
|
|
||
6 years ago
|
### Expected function
|
||
|
|
||
|
```go
|
||
|
func Raid1a(x,y int) {
|
||
|
|
||
|
}
|
||
|
```
|
||
|
|
||
|
### Usage
|
||
|
|
||
|
Here is are possible programs to test your function :
|
||
|
|
||
|
Program #1
|
||
|
|
||
|
```go
|
||
|
package main
|
||
|
|
||
5 years ago
|
import piscine ".."
|
||
6 years ago
|
|
||
|
func main() {
|
||
5 years ago
|
piscine.Raid1a(5,3)
|
||
6 years ago
|
}
|
||
|
```
|
||
|
|
||
|
And its output :
|
||
|
|
||
|
```console
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$ go build
|
||
|
student@ubuntu:~/[[ROOT]]/test$ ./test
|
||
6 years ago
|
o---o
|
||
|
| |
|
||
|
o---o
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$
|
||
6 years ago
|
```
|
||
|
|
||
|
Program #2
|
||
|
|
||
|
```go
|
||
|
package main
|
||
|
|
||
5 years ago
|
import piscine ".."
|
||
6 years ago
|
|
||
|
func main() {
|
||
5 years ago
|
piscine.Raid1a(5,1)
|
||
6 years ago
|
}
|
||
|
```
|
||
|
|
||
|
And its output :
|
||
|
|
||
|
```console
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$ go build
|
||
|
student@ubuntu:~/[[ROOT]]/test$ ./test
|
||
6 years ago
|
o---o
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$
|
||
6 years ago
|
```
|
||
|
|
||
|
Program #3
|
||
|
|
||
|
```go
|
||
|
package main
|
||
|
|
||
5 years ago
|
import piscine ".."
|
||
6 years ago
|
|
||
|
func main() {
|
||
5 years ago
|
piscine.Raid1a(1,1)
|
||
6 years ago
|
}
|
||
|
```
|
||
|
|
||
|
And its output :
|
||
|
|
||
|
```console
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$ go build
|
||
|
student@ubuntu:~/[[ROOT]]/test$ ./test
|
||
6 years ago
|
o
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$
|
||
6 years ago
|
```
|
||
|
|
||
|
Program #4
|
||
|
|
||
|
```go
|
||
|
package main
|
||
|
|
||
5 years ago
|
import piscine ".."
|
||
6 years ago
|
|
||
|
func main() {
|
||
5 years ago
|
piscine.Raid1a(1,5)
|
||
6 years ago
|
}
|
||
|
```
|
||
|
|
||
|
And its output :
|
||
|
|
||
|
```console
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$ go build
|
||
|
student@ubuntu:~/[[ROOT]]/test$ ./test
|
||
6 years ago
|
o
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
o
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$
|
||
6 years ago
|
```
|