mirror of https://github.com/01-edu/public.git
lee
4 years ago
8 changed files with 1079 additions and 555 deletions
@ -0,0 +1,569 @@
|
||||
# raid1 |
||||
|
||||
## raid1a |
||||
|
||||
### Instructions |
||||
|
||||
Write a function `Raid1a` that prints a **valid** rectangle of width `x` and of height `y`. |
||||
|
||||
The function must draw the rectangles as in the examples. |
||||
|
||||
`x` and `y` will always be positive numbers. Otherwise, the function should print nothing. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
func Raid1a(x,y int) { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here are possible programs to test your function : |
||||
|
||||
Program #1 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1a(5,3) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
o---o |
||||
| | |
||||
o---o |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #2 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1a(5,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
o---o |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #3 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1a(1,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
o |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #4 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1a(1,5) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
o |
||||
| |
||||
| |
||||
| |
||||
o |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
---- |
||||
|
||||
## raid1b |
||||
|
||||
### Instructions |
||||
|
||||
Write a function `Raid1b` that prints a **valid** rectangle of width `x` and of height `y`. |
||||
|
||||
The function must draw the rectangles as in the examples. |
||||
|
||||
`x` and `y` will always be positive numbers. Otherwise, the function should print nothing. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
func Raid1b(x,y int) { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here are possible programs to test your function : |
||||
|
||||
Program #1 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1b(5,3) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
/***\ |
||||
* * |
||||
\***/ |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #2 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1b(5,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
/***\ |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #3 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1b(1,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
/ |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #4 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1b(1,5) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
/ |
||||
* |
||||
* |
||||
* |
||||
\ |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
---- |
||||
|
||||
## raid1c |
||||
|
||||
### Instructions |
||||
|
||||
Write a function `Raid1c` that prints a **valid** rectangle of width `x` and of height `y`. |
||||
|
||||
The function must draw the rectangles as in the examples. |
||||
|
||||
`x` and `y` will always be positive numbers. Otherwise, the function should print nothing. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
func Raid1c(x,y int) { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here are possible programs to test your function : |
||||
|
||||
Program #1 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1c(5,3) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
ABBBA |
||||
B B |
||||
CBBBC |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #2 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1c(5,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
ABBBA |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #3 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1c(1,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
A |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #4 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1c(1,5) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
A |
||||
B |
||||
B |
||||
B |
||||
C |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
---- |
||||
|
||||
## raid1d |
||||
|
||||
### Instructions |
||||
|
||||
Write a function `Raid1d` that prints a **valid** rectangle of width `x` and of height `y`. |
||||
|
||||
The function must draw the rectangles as in the examples. |
||||
|
||||
`x` and `y` will always be positive numbers. Otherwise, the function should print nothing. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
func Raid1d(x,y int) { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here are possible programs to test your function : |
||||
|
||||
Program #1 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1d(5,3) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
ABBBC |
||||
B B |
||||
ABBBC |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #2 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1d(5,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
ABBBC |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #3 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1d(1,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
A |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #4 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1d(1,5) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
A |
||||
B |
||||
B |
||||
B |
||||
A |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
---- |
||||
|
||||
## raid1e |
||||
|
||||
### Instructions |
||||
|
||||
Write a function `Raid1e` that prints a **valid** rectangle of width `x` and of height `y`. |
||||
|
||||
The function must draw the rectangles as in the examples. |
||||
|
||||
`x` and `y` will always be positive numbers. Otherwise, the function should print nothing. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
func Raid1e(x,y int) { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here are possible programs to test your function : |
||||
|
||||
Program #1 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1e(5,3) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
ABBBC |
||||
B B |
||||
CBBBA |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #2 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1e(5,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
ABBBC |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #3 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1e(1,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
A |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #4 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1e(1,5) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
A |
||||
B |
||||
B |
||||
B |
||||
C |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
@ -0,0 +1,437 @@
|
||||
#### raid1a |
||||
|
||||
##### Try running the function with the arguments: `"x=5 and y=3"` |
||||
|
||||
``` |
||||
o---o |
||||
| | |
||||
o---o |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=5 and y=1"` |
||||
|
||||
``` |
||||
o---o |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=1 and y=1"` |
||||
|
||||
``` |
||||
o |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=1 and y=5"` |
||||
|
||||
``` |
||||
o |
||||
| |
||||
| |
||||
| |
||||
o |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=0 and y=0"` |
||||
|
||||
###### Does the function returns nothing? |
||||
|
||||
##### Try running the function with the arguments: `"x=-1 and y=6"` |
||||
|
||||
###### Does the function returns nothing? |
||||
|
||||
##### Try running the function with the arguments: `"x=6 and y=-1"` |
||||
|
||||
###### Does the function returns nothing? |
||||
|
||||
##### Try running the function with the arguments: `"x=20 and y=1"` |
||||
|
||||
``` |
||||
o------------------o |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
|
||||
##### Try running the function with the arguments: `"x=10 and y=8"` |
||||
|
||||
``` |
||||
o--------o |
||||
| | |
||||
| | |
||||
| | |
||||
| | |
||||
| | |
||||
| | |
||||
o--------o |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
#### raid1b |
||||
|
||||
##### Try running the function with the arguments: `"x=5 and y=3"` |
||||
|
||||
``` |
||||
/***\ |
||||
* * |
||||
\***/ |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=5 and y=1"` |
||||
|
||||
``` |
||||
/***\ |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
|
||||
##### Try running the function with the arguments: `"x=1 and y=1"` |
||||
|
||||
``` |
||||
/ |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=1 and y=5"` |
||||
|
||||
``` |
||||
/ |
||||
* |
||||
* |
||||
* |
||||
\ |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=0 and y=0"` |
||||
|
||||
###### Does the function returns nothing? |
||||
|
||||
##### Try running the function with the arguments: `"x=-1 and y=6"` |
||||
|
||||
###### Does the function returns nothing? |
||||
|
||||
##### Try running the function with the arguments: `"x=6 and y=-1"` |
||||
|
||||
###### Does the function returns nothing? |
||||
|
||||
##### Try running the function with the arguments: `"x=18 and y=6"` |
||||
|
||||
``` |
||||
/****************\ |
||||
* * |
||||
* * |
||||
* * |
||||
* * |
||||
\****************/ |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=9 and y=3"` |
||||
|
||||
``` |
||||
/*******\ |
||||
* * |
||||
\*******/ |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
#### raid1c |
||||
|
||||
##### Try running the function with the arguments: `"x=5 and y=3"` |
||||
|
||||
``` |
||||
ABBBA |
||||
B B |
||||
CBBBC |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=5 and y=1"` |
||||
|
||||
``` |
||||
ABBBA |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=1 and y=1"` |
||||
|
||||
``` |
||||
A |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=1 and y=5"` |
||||
|
||||
``` |
||||
A |
||||
B |
||||
B |
||||
B |
||||
C |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=0 and y=0"` |
||||
|
||||
###### Does the function returns nothing? |
||||
|
||||
##### Try running the function with the arguments: `"x=-1 and y=6"` |
||||
|
||||
###### Does the function returns nothing? |
||||
|
||||
##### Try running the function with the arguments: `"x=6 and y=-1"` |
||||
|
||||
###### Does the function returns nothing? |
||||
|
||||
##### Try running the function with the arguments: `"x=13 and y=7"` |
||||
|
||||
``` |
||||
ABBBBBBBBBBBA |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
CBBBBBBBBBBBC |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=10 and y=15"` |
||||
|
||||
``` |
||||
ABBBBBBBBA |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
CBBBBBBBBC |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
#### raid1d |
||||
|
||||
##### Try running the function with the arguments: `"x=5 and y=3"` |
||||
|
||||
``` |
||||
ABBBC |
||||
B B |
||||
ABBBC |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=5 and y=1"` |
||||
|
||||
``` |
||||
ABBBC |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=1 and y=1"` |
||||
|
||||
``` |
||||
A |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=1 and y=5"` |
||||
|
||||
``` |
||||
A |
||||
B |
||||
B |
||||
B |
||||
A |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=0 and y=0"` |
||||
|
||||
###### Does the function returns nothing? |
||||
|
||||
##### Try running the function with the arguments: `"x=-1 and y=6"` |
||||
|
||||
###### Does the function returns nothing? |
||||
|
||||
##### Try running the function with the arguments: `"x=6 and y=-1"` |
||||
|
||||
###### Does the function returns nothing? |
||||
|
||||
##### Try running the function with the arguments: `"x=3 and y=16"` |
||||
|
||||
``` |
||||
ABC |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
ABC |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=7 and y=16"` |
||||
|
||||
``` |
||||
ABBBBBC |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
ABBBBBC |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
#### raid1e |
||||
|
||||
##### Try running the function with the arguments: `"x=5 and y=3"` |
||||
|
||||
``` |
||||
ABBBC |
||||
B B |
||||
CBBBA |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=5 and y=1"` |
||||
|
||||
``` |
||||
ABBBC |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=1 and y=1"` |
||||
|
||||
``` |
||||
A |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=1 and y=5"` |
||||
|
||||
``` |
||||
A |
||||
B |
||||
B |
||||
B |
||||
C |
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=0 and y=0"` |
||||
|
||||
###### Does the function returns nothing? |
||||
|
||||
##### Try running the function with the arguments: `"x=-1 and y=6"` |
||||
|
||||
###### Does the function returns nothing? |
||||
|
||||
##### Try running the function with the arguments: `"x=6 and y=-1"` |
||||
|
||||
###### Does the function returns nothing? |
||||
|
||||
##### Try running the function with the arguments: `"x=21 and y=24"` |
||||
|
||||
``` |
||||
ABBBBBBBBBBBBBBBBBBBC |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
CBBBBBBBBBBBBBBBBBBBA |
||||
|
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
||||
|
||||
##### Try running the function with the arguments: `"x=18 and y=8"` |
||||
|
||||
``` |
||||
ABBBBBBBBBBBBBBBBC |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
B B |
||||
CBBBBBBBBBBBBBBBBA |
||||
|
||||
``` |
||||
|
||||
###### Does the function returns the value above? |
@ -1,111 +0,0 @@
|
||||
## raid1a |
||||
|
||||
### Instructions |
||||
|
||||
Write a function `Raid1a` that prints a **valid** rectangle of width `x` and of height `y`. |
||||
|
||||
The function must draw the rectangles as in the examples. |
||||
|
||||
`x` and `y` will always be positive numbers. Otherwise, the function should print nothing. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
func Raid1a(x,y int) { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is are possible programs to test your function : |
||||
|
||||
Program #1 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1a(5,3) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
o---o |
||||
| | |
||||
o---o |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #2 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1a(5,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
o---o |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #3 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1a(1,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
o |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #4 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1a(1,5) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
o |
||||
| |
||||
| |
||||
| |
||||
o |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
@ -1,111 +0,0 @@
|
||||
## raid1b |
||||
|
||||
### Instructions |
||||
|
||||
Write a function `Raid1b` that prints a **valid** rectangle of width `x` and of height `y`. |
||||
|
||||
The function must draw the rectangles as in the examples. |
||||
|
||||
`x` and `y` will always be positive numbers. Otherwise, the function should print nothing. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
func Raid1b(x,y int) { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is are possible programs to test your function : |
||||
|
||||
Program #1 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1b(5,3) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
/***\ |
||||
* * |
||||
\***/ |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #2 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1b(5,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
/***\ |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #3 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1b(1,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
/ |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #4 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1b(1,5) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
/ |
||||
* |
||||
* |
||||
* |
||||
\ |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
@ -1,111 +0,0 @@
|
||||
## raid1c |
||||
|
||||
### Instructions |
||||
|
||||
Write a function `Raid1c` that prints a **valid** rectangle of width `x` and of height `y`. |
||||
|
||||
The function must draw the rectangles as in the examples. |
||||
|
||||
`x` and `y` will always be positive numbers. Otherwise, the function should print nothing. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
func Raid1c(x,y int) { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is are possible programs to test your function : |
||||
|
||||
Program #1 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1c(5,3) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
ABBBA |
||||
B B |
||||
CBBBC |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #2 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1c(5,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
ABBBA |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #3 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1c(1,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
A |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #4 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1c(1,5) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
A |
||||
B |
||||
B |
||||
B |
||||
C |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
@ -1,111 +0,0 @@
|
||||
## raid1d |
||||
|
||||
### Instructions |
||||
|
||||
Write a function `Raid1d` that prints a **valid** rectangle of width `x` and of height `y`. |
||||
|
||||
The function must draw the rectangles as in the examples. |
||||
|
||||
`x` and `y` will always be positive numbers. Otherwise, the function should print nothing. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
func Raid1d(x,y int) { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is are possible programs to test your function : |
||||
|
||||
Program #1 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1d(5,3) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
ABBBC |
||||
B B |
||||
ABBBC |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #2 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1d(5,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
ABBBC |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #3 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1d(1,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
A |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #4 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1d(1,5) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
A |
||||
B |
||||
B |
||||
B |
||||
A |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
@ -1,111 +0,0 @@
|
||||
## raid1e |
||||
|
||||
### Instructions |
||||
|
||||
Write a function `Raid1e` that prints a **valid** rectangle of width `x` and of height `y`. |
||||
|
||||
The function must draw the rectangles as in the examples. |
||||
|
||||
`x` and `y` will always be positive numbers. Otherwise, the function should print nothing. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
func Raid1e(x,y int) { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is are possible programs to test your function : |
||||
|
||||
Program #1 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1e(5,3) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
ABBBC |
||||
B B |
||||
CBBBA |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #2 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1e(5,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
ABBBC |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #3 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1e(1,1) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
A |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
||||
|
||||
Program #4 |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import piscine ".." |
||||
|
||||
func main() { |
||||
piscine.Raid1e(1,5) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
student@ubuntu:~/[[ROOT]]/test$ go build |
||||
student@ubuntu:~/[[ROOT]]/test$ ./test |
||||
A |
||||
B |
||||
B |
||||
B |
||||
C |
||||
student@ubuntu:~/[[ROOT]]/test$ |
||||
``` |
@ -0,0 +1,73 @@
|
||||
#### Raid 3 |
||||
|
||||
##### Try running the program: `"./raid1a 3 3 | ./raid3"` |
||||
|
||||
``` |
||||
[raid1a] [3] [3] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./raid1b 3 3 | ./raid3"` |
||||
|
||||
``` |
||||
[raid1b] [3] [3] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./raid1c 1 1 | ./raid3"` |
||||
|
||||
``` |
||||
[raid1c] [1] [1] || [raid1d] [1] [1] || [raid1e] [1] [1] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./raid1e 1 2 | ./raid3"` |
||||
|
||||
``` |
||||
[raid1c] [1] [2] || [raid1e] [1] [2] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./raid1e 2 1 | ./raid3"` |
||||
|
||||
``` |
||||
[raid1d] [2] [1] || [raid1e] [2] [1] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./raid1c 2 1 | ./raid3"` |
||||
|
||||
``` |
||||
[raid1c] [2] [1] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./raid1d 1 2 | ./raid3"` |
||||
|
||||
``` |
||||
[raid1d] [1] [2] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"./raid1e 1 1 | ./raid3"` |
||||
|
||||
``` |
||||
[raid1c] [1] [1] || [raid1d] [1] [1] || [raid1e] [1] [1] |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
||||
|
||||
##### Try running the program: `"echo 0 0 | ./raid3"` |
||||
|
||||
``` |
||||
Not a Raid function |
||||
``` |
||||
|
||||
###### Does the program returns the value above? |
Loading…
Reference in new issue