-
Notifications
You must be signed in to change notification settings - Fork 47
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
[로또 미션] 최준호 미션 제출합니다. #45
base: choi-jjunho
Are you sure you want to change the base?
Conversation
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.
고생하셨습니다~~ 코멘트 확인 부탁드려요!
private static String defaultViewMessage(LottoRate rate, int count) { | ||
return String.format("%d개 일치 (%d)- %d개", rate.matchCount, rate.price, count); | ||
} | ||
|
||
private static String bonusViewMessage(LottoRate rate, int count) { | ||
return String.format("%d개 일치, 보너스 볼 일치(%d)- %d개", rate.matchCount, rate.price, count); | ||
} | ||
|
||
@FunctionalInterface | ||
public interface ViewMessageFormatter { | ||
String format(LottoRate rate, int count); | ||
} |
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 (rate != NONE) { | ||
result.put(rate, result.getOrDefault(rate, 0) + 1); | ||
} |
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 List<Integer> getNumbers() { | ||
return numbers.stream() | ||
.map(LottoNumber::getNumber) | ||
.toList(); | ||
} |
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.
List로 반환하는 이유가 있나요?
while (stringTokenizer.hasMoreTokens()) { | ||
int number = Integer.parseInt(stringTokenizer.nextToken()); | ||
numbers.add(number); | ||
} | ||
result.add(numbers); | ||
} |
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.
작년 프리코스에 구현하고 오랜만에 구현하니 추억이 새록새록하네요
읽기좋은 코드 만들기 정말 어렵네요 ㅋㅋㅋㅋ