-
Notifications
You must be signed in to change notification settings - Fork 738
Expand file tree
/
Copy pathLadderApplication.java
More file actions
24 lines (20 loc) · 926 Bytes
/
LadderApplication.java
File metadata and controls
24 lines (20 loc) · 926 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
package ladder;
import ladder.dto.LadderRequest;
import ladder.dto.LadderResponse;
import ladder.service.LadderService;
import ladder.view.InputView;
import ladder.view.LinePrinter;
import ladder.view.ResultView;
public class LadderApplication {
public static void main(String[] args) {
InputView inputView = new InputView();
String participant = inputView.inputParticipant();
String[] splitParticipants = inputView.splitParticipants(participant);
int ladderLimitCount = inputView.inputLadderLimitCount();
LadderService ladderService = new LadderService();
LadderResponse response = ladderService.createLadder(new LadderRequest(splitParticipants, ladderLimitCount));
LinePrinter printer = new LinePrinter(ladderLimitCount);
ResultView resultView = new ResultView(printer, splitParticipants, response.getLines());
resultView.showResult();
}
}