Skip to content

Conversation

@youngreal
Copy link

No description provided.

Comment on lines +36 to +44
private void calculateMaxValue(CarStorage carStorage, int i) {
if (isOverMaxLocation(carStorage, i)) {
max= carStorage.getNotAdvanceCar(i).length();
}
}

private boolean isOverMaxLocation(CarStorage carStorage, int i) {
return carStorage.getNotAdvanceCar(i).length() > max;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 구현체에서 carStorage.getNotAdvanceCar(i)의 length() 값을 가져오는 방식보다 carStorage 안에엇 특정한 자동차의 length를 제공하는 메서드를 만드는 방식이 더 좋아보입니다. ☺️

Comment on lines +47 to +52
for (int i = 0; i < answer.length(); i++) {
System.out.print(answer.charAt(i));
if (isNotFinalSequence(i)) {
System.out.print(",");
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

한 메서드에 오직 한 단계의 들여쓰기만 한다라는 객체 지향 생활 원칙을 지켜보는건 어떨까요? ☺️

}

public static int generateRandomNumber() {
return (int) (Math.random() * 10);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요구사항에는 전진하는 조건은 0에서 9 사이에서 random 값을 구한 후 random 값이 4이상일 경우이다.이라 적혀있지만, 해당 난수 생성은 0 ~ 10 사이의 정수를 반환하고 있어 요구 사항과 달라보입니다. 🥺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants