File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,16 @@ public Application(String[] carNames, int maxTurnCount) {
2323 }
2424 }
2525
26+ public void start () {
27+ PrintManager .printResultMessage ();
28+ for (int i = 0 ; i < maxTurnCount ; i ++) {
29+ for (Car car : cars ) {
30+ car .randomlyGoForward ();
31+ }
32+ PrintManager .printCarData (cars );
33+ }
34+ }
35+
2636 private void checkDuplicateName (String [] carNamesArray ) {
2737 Set <String > carNamesSet = new HashSet <>(Arrays .asList (carNamesArray ));
2838 if (carNamesSet .size () != carNamesArray .length ) {
@@ -36,7 +46,7 @@ private void checkTurnValid(int turn) {
3646 }
3747 }
3848
39- private List <Car > getWinners (){
49+ private List <Car > getWinnerCars (){
4050 List <Car > winners = new ArrayList <>();
4151 int maxPosition = 0 ;
4252 for (Car car : cars ) {
You can’t perform that action at this time.
0 commit comments