-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathApplication.java
More file actions
28 lines (22 loc) · 868 Bytes
/
Application.java
File metadata and controls
28 lines (22 loc) · 868 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
package racingcar;
import java.util.List;
public class Application {
public static void main(String[] args) {
try {
InputManager inputManager = new InputManager();
OutputManager outputManager = new OutputManager();
List<String> carNames = inputManager.getCarNames();
int numberOfRounds = inputManager.getNumberOfRounds();
RacingGame game = new RacingGame(carNames);
System.out.println("\n실행 결과");
for (int i = 0; i < numberOfRounds; i++) {
game.playRound();
outputManager.printRoundResult(game.getCars());
}
outputManager.printWinners(game.getWinners());
} catch (IllegalArgumentException e) {
System.out.println("[ERROR] " + e.getMessage());
throw e;
}
}
}