Open
Conversation
dradnats1012
reviewed
Apr 1, 2025
| printer.printWinners(game.findWinners()); | ||
| } | ||
|
|
||
| private static List<Car> inputCarNames() { |
There was a problem hiding this comment.
static으로 선언한 이유가 있을까요?
다른 방식은 없었는지 궁금합니당
Comment on lines
+39
to
+41
| } catch (NumberFormatException e) { | ||
| throw new IllegalArgumentException("숫자를 입력해야 합니다."); | ||
| } |
| } | ||
|
|
||
| public void move() { | ||
| if (Randoms.pickNumberInRange(0, 9) >= 4) |
There was a problem hiding this comment.
랜덤 숫자를 만드는 함수로 빼도 좋을 것 같아요
ex) power()
Comment on lines
+22
to
+26
| for (Car car : cars) { | ||
| if (car.getPosition() > fastest) { | ||
| fastest = car.getPosition(); | ||
| } | ||
| } |
There was a problem hiding this comment.
findFastest() 라는 메서드로 뺼 수 있을 것 같아요!
Comment on lines
+27
to
+29
| if (carName.length() > 5) { | ||
| throw new IllegalArgumentException("자동차 이름은 5자 이하만 가능합니다."); | ||
| } |
There was a problem hiding this comment.
차 이름에 대한 검증을 메인클래스에서 진행하는게 어색하네요
Car 클래스나 따로 CarName이라는 클래스를 만들어서 진행하는 방법은 어떠신가요?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.