-
Notifications
You must be signed in to change notification settings - Fork 0
/
quadB.go
45 lines (40 loc) · 863 Bytes
/
quadB.go
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
package main
import (
"os"
"strconv"
"github.com/01-edu/z01"
)
func QuadB(x, y int) {
if x > 0 && y > 0 {
for m := 1; m <= y; m++ {
for b := 1; b <= x; b++ {
if m == 1 && b == 1 {
z01.PrintRune('/')
} else if m == 1 && b > 1 && b < x {
z01.PrintRune('*')
} else if m == 1 && b == x {
z01.PrintRune('\\')
} else if b == 1 && m > 1 && m < y {
z01.PrintRune('*')
} else if m > 1 && m < y && b > 1 && b < x {
z01.PrintRune(' ')
} else if m > 1 && m < y && b == x {
z01.PrintRune('*')
} else if m == y && b == 1 {
z01.PrintRune('\\')
} else if m == y && b > 1 && b < x {
z01.PrintRune('*')
} else {
z01.PrintRune('/')
}
}
z01.PrintRune('\n')
}
}
}
func main() {
args := os.Args[1:]
x, _ := strconv.Atoi(args[0])
y, _ := strconv.Atoi(args[1])
QuadB(x, y)
}