-
Notifications
You must be signed in to change notification settings - Fork 712
/
Copy pathLadderController.java
34 lines (29 loc) · 1.23 KB
/
LadderController.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
package nextstep.ladder.application;
import nextstep.ladder.application.dto.LadderRequest;
import nextstep.ladder.application.dto.LadderResponse;
import nextstep.ladder.application.service.LadderService;
import nextstep.ladder.ui.LinePrinter;
import nextstep.ladder.ui.InputView;
import nextstep.ladder.ui.ResultView;
public class LadderController {
public static void main(String[] args) {
InputView inputView = new InputView();
String[] participants = inputView.inputParticipant();
String[] results = inputView.inputResults();
int highCount = inputView.inputHighCount();
LadderService ladderService = new LadderService();
LadderResponse createResponse = ladderService.findWinner(new LadderRequest(
participants,
results,
highCount));
LinePrinter printer = new LinePrinter(highCount);
ResultView resultView = new ResultView(
printer,
createResponse.getLines(),
createResponse.getParticipants(),
results);
resultView.showLadder();
resultView.showParticipant(inputView.inputWantShow());
resultView.showParticipant(inputView.inputWantShow());
}
}