-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathRacingMain.java
More file actions
29 lines (24 loc) · 889 Bytes
/
RacingMain.java
File metadata and controls
29 lines (24 loc) · 889 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
import controller.RacingStart;
import domain.Car;
import domain.RacingGame;
import domain.Winner;
import view.InputView;
import view.OutputView;
import java.io.IOException;
import java.util.List;
public class RacingMain {
public static void main(String[] args) throws IOException {
// TODO: MVC 패턴을 기반으로 자동차 경주 미션 구현해보기
run();
}
private static void run() throws IOException {
final String CARNAMES = InputView.getCarNames();
final List<Car> racingCars = RacingGame.generateCars(CARNAMES);
final int CNT = InputView.getTryCount();
RacingGame racingGame = new RacingGame(racingCars);
RacingStart.startRace(CNT, racingGame);
Winner winner = new Winner();
final List<String> winners = winner.findWinners(racingCars);
OutputView.printWinners(winners);
}
}