-
Notifications
You must be signed in to change notification settings - Fork 738
Expand file tree
/
Copy pathInputView.java
More file actions
36 lines (25 loc) · 935 Bytes
/
InputView.java
File metadata and controls
36 lines (25 loc) · 935 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
package ladder.view;
import java.util.Scanner;
public class InputView {
private InputView() {
}
private static final String COMMA = ",";
private static final Scanner scanner = new Scanner(System.in);
public static String[] getNames() {
System.out.println("참여할 사람 이름을 입력하세요. (이름은 쉼표(,)로 구분하세요)");
return scanner.next().split(COMMA);
}
public static int getHeight() {
System.out.println("최대 사다리 높이는 몇 개인가요?");
return scanner.nextInt();
}
public static String[] getResult() {
System.out.println("실행 결과를 입력하세요. (결과는 쉼표(,)로 구분하세요)");
return scanner.next().split(COMMA);
}
public static String getTargetPlayer()
{
System.out.println("결과를 보고 싶은 사람은?");
return scanner.next();
}
}