-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquadF.go
More file actions
46 lines (40 loc) · 820 Bytes
/
quadF.go
File metadata and controls
46 lines (40 loc) · 820 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
package piscine
import "github.com/01-edu/z01"
// corner topleft always there
// corner topright if x!=1
// corner bottomleft if y!=1
// corner bottomright if x!=1 && y!=1
func QuadF(x, y int) {
if x > 0 && y > 0 {
z01.PrintRune('o')
if x != 1 {
for i := 2; i < x; i++ {
z01.PrintRune('-')
}
z01.PrintRune('o')
}
z01.PrintRune('\n')
// first line ends here
if y != 1 {
for j := 2; j < y; j++ {
z01.PrintRune('|')
if x != 1 {
for i := 2; i < x; i++ {
z01.PrintRune(' ')
}
z01.PrintRune('|')
}
z01.PrintRune('\n')
}
// middle line ends here
z01.PrintRune('o')
if x != 1 {
for i := 2; i < x; i++ {
z01.PrintRune('-')
}
z01.PrintRune('o')
z01.PrintRune('\n')
}
}
}
}