-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathBridgeBoard.java
More file actions
39 lines (32 loc) · 842 Bytes
/
BridgeBoard.java
File metadata and controls
39 lines (32 loc) · 842 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
package bridge;
import java.util.ArrayList;
import java.util.List;
public class BridgeBoard {
private List<String> upBridge = new ArrayList<>();
private List<String> downBridge = new ArrayList<>();
public void drawUpMovement(boolean isSuccess) {
String marker = "X";
if (isSuccess) {
marker = "O";
}
upBridge.add(marker);
downBridge.add(" ");
}
public void drawDownMovement(boolean isSuccess) {
String marker = "X";
if (isSuccess) {
marker = "O";
}
upBridge.add(" ");
downBridge.add(marker);
}
public int getSize() {
return upBridge.size();
}
public List<String> getUpBridge() {
return upBridge;
}
public List<String> getDownBridge() {
return downBridge;
}
}