-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathOutputView.java
More file actions
37 lines (33 loc) · 920 Bytes
/
OutputView.java
File metadata and controls
37 lines (33 loc) · 920 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
package view;
import java.util.List;
public class OutputView {
public static void printAnnouncement(){
System.out.println("실행 결과");
}
public static void moveCarResult(String[] carNames, int[] carMoveRecord) {
int idx = 0;
for(String s : carNames)
{
System.out.print(s + " : ");
String result = "-".repeat(carMoveRecord[idx++]);
System.out.println(result);
}
System.out.print("\n");
}
public static void printWinners(List<String> winners) {
boolean comma = false;
for(String s : winners)
{
if(comma)
{
System.out.println(", ");
}
else if(!comma)
{
comma = true;
}
System.out.print(s);
}
System.out.println("가 최종 우승했습니다.");
}
}