forked from root/public
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
|
## raid1b
|
||
|
|
||
|
### Instructions
|
||
|
|
||
![]()
5 years ago
|
Write a function `Raid1b` 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 Raid1b(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.Raid1b(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
|
/***\
|
||
|
* *
|
||
|
\***/
|
||
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.Raid1b(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
|
/***\
|
||
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.Raid1b(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
|
/
|
||
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.Raid1b(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
|
/
|
||
|
*
|
||
|
*
|
||
|
*
|
||
|
\
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$
|
||
5 years ago
|
```
|