-
Notifications
You must be signed in to change notification settings - Fork 738
Expand file tree
/
Copy pathLadderController.java
More file actions
27 lines (21 loc) · 963 Bytes
/
LadderController.java
File metadata and controls
27 lines (21 loc) · 963 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
package nextstep.ladder.controller;
import nextstep.ladder.domain.*;
import nextstep.ladder.domain.strategy.RandomLadderPoint;
import nextstep.ladder.view.InputView;
import nextstep.ladder.view.OutputView;
import java.util.List;
public class LadderController {
public static void main(String[] args) {
Names names = InputView.inputNames();
List<LadderResult> inputLadderResults = InputView.inputLadderResults();
Height height = InputView.inputHeight();
Lines lines = new Lines();
lines.initialize(names.size(), height, new RandomLadderPoint());
OutputView.printNames(names);
OutputView.printLadders(lines);
OutputView.printInputResults(inputLadderResults);
LadderGame ladderGame = new LadderGame(names, lines, inputLadderResults);
LadderResults ladderResults = ladderGame.play();
OutputView.printResultByName(InputView.inputNameForResult(), ladderResults);
}
}