-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRacingCarApp.java
More file actions
32 lines (24 loc) · 882 Bytes
/
RacingCarApp.java
File metadata and controls
32 lines (24 loc) · 882 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
30
31
32
package racingcar.controller;
import racingcar.domain.Car;
import racingcar.domain.CarList;
import racingcar.view.InputView;
import racingcar.view.ResultView;
import java.util.Arrays;
public class RacingCarApp {
public static void main(String[] args) {
InputView inputView = new InputView();
inputView.whatCarNamesAre();
String nameOfCars = inputView.getUserStringInput();
inputView.howManyTimes();
int numberOfTimes = inputView.getUserIntInput();
CarList carList = new CarList(nameOfCars);
ResultView resultView = new ResultView();
for (int i = 0; i < numberOfTimes; i += 1) {
resultView.clear();
carList.moveAllCars();
resultView.showResult(carList.getCars());
resultView.sleep(1000);
}
resultView.showWinner(carList.getWinners());
}
}