-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquadA2.go
More file actions
49 lines (41 loc) · 768 Bytes
/
quadA2.go
File metadata and controls
49 lines (41 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package piscine
import "fmt"
func Drawrec(x, y int, TLC, TRC, TS, BLC, BRC, S string) {
if x > 0 && y > 0 {
fmt.Print(TLC)
if x != 1 {
for i := 2; i < x; i++ {
fmt.Print(TS)
}
fmt.Print(TRC)
}
fmt.Print('\n')
// first line ends here
if y != 1 {
for j := 2; j < y; j++ {
fmt.Print(S)
if x != 1 {
for i := 2; i < x; i++ {
fmt.Print(' ')
}
fmt.Print(S)
}
fmt.Print('\n')
}
// middle line ends here
fmt.Print(BLC)
if x != 1 {
for i := 2; i < x; i++ {
fmt.Print(TS)
}
fmt.Print(BRC)
}
fmt.Print('\n')
}
}
}
func QuadA2(x, y int) {
width := x
height := y
Drawrec(width, height, "o", "o", "-", "o", "o", "|")
}