-
Notifications
You must be signed in to change notification settings - Fork 0
/
missandcan.java
51 lines (48 loc) · 1.58 KB
/
missandcan.java
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
50
51
public class missandcan {
public static void display(char x, char y, int rm, int rc, int lm, int lc, int flag) {
System.out.println();
for (int i = 0; i < lm; i++) {
System.out.print(" M");
}
for (int i = 0; i < lc; i++) {
System.out.print(" C ");
}
if (flag == 0) {
System.out.print("__________W" + "___________B(" + x + "," + y + ")");
} else {
System.out.print("B(" + x + "," + y + ")________W__________");
}
for (int i = 0; i < rm; i++) {
System.out.print(" M");
}
for (int i = 0; i < rc; i++) {
System.out.print(" C");
}
}
public static void main(String[] args) {
display(' ',' ',3,3,0,0,0);
display('C','C',3,1,0,0,0);
display('C','C',3,1,0,0,1);
display('C',' ',3,1,0,1,1);
display('C',' ',3,1,0,1,0);
display('C','C',3,0,0,1,0);
display('C','C',3,0,0,1,1);
display('C',' ',3,0,0,2,1);
display('C',' ',3,0,0,2,0);
display('M','M',1,1,0,2,0);
display('M','M',1,1,0,2,1);
display('C','M',1,1,1,1,1);
display('C','M',1,1,1,1,0);
display('M','M',0,2,1,1,0);
display('M','M',0,2,1,1,1);
display('C',' ',0,2,3,0,1);
display('C',' ',0,2,3,0,0);
display('C','C',0,1,3,0,0);
display('C','C',0,1,3,0,1);
display('C',' ',0,1,3,1,1);
display('C',' ',0,1,3,1,0);
display('C','C',0,0,3,1,0);
display('C','C',0,0,3,1,1);
display(' ',' ',0,0,3,3,1);
}
}