-
Notifications
You must be signed in to change notification settings - Fork 55
[이현성_BackEnd] 2주차 과제 제출입니다. #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
dradnats1012
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다! 👍
몇가지 리뷰만 확인해주세요!!
| printer.printWinners(game.findWinners()); | ||
| } | ||
|
|
||
| private static List<Car> inputCarNames() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static으로 선언한 이유가 있을까요?
다른 방식은 없었는지 궁금합니당
| } catch (NumberFormatException e) { | ||
| throw new IllegalArgumentException("숫자를 입력해야 합니다."); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
음수가 들어오면 어떻게 될까요?
| } | ||
|
|
||
| public void move() { | ||
| if (Randoms.pickNumberInRange(0, 9) >= 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
랜덤 숫자를 만드는 함수로 빼도 좋을 것 같아요
ex) power()
| for (Car car : cars) { | ||
| if (car.getPosition() > fastest) { | ||
| fastest = car.getPosition(); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
findFastest() 라는 메서드로 뺼 수 있을 것 같아요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
출력관련 클래스를 만드셨네요 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
입력 관련 클래스도 만들 수 있을 것 같아요!
| if (carName.length() > 5) { | ||
| throw new IllegalArgumentException("자동차 이름은 5자 이하만 가능합니다."); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
차 이름에 대한 검증을 메인클래스에서 진행하는게 어색하네요
Car 클래스나 따로 CarName이라는 클래스를 만들어서 진행하는 방법은 어떠신가요?
No description provided.