-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathLadderView.java
More file actions
32 lines (26 loc) · 820 Bytes
/
LadderView.java
File metadata and controls
32 lines (26 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
package view;
import dto.LadderDto;
import java.util.List;
public class LadderView {
private static final String BRIDGE = "-----|";
private static final String SPACE = " |";
private static final String BAR = "|";
public static void printLadder(LadderDto ladderDto) {
System.out.println();
System.out.println("실행결과");
System.out.println();
ladderDto.getLadderData().forEach(LadderView::printLine);
}
private static void printLine(List<Boolean> line) {
System.out.print(BAR);
line.forEach(LadderView::printPoint);
System.out.println();
}
private static void printPoint(Boolean point) {
if (point) {
System.out.print(BRIDGE);
return;
}
System.out.print(SPACE);
}
}