-
Notifications
You must be signed in to change notification settings - Fork 65
로또 2단계 미션 제출합니다. #39
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
로또 2단계 미션 제출합니다. #39
Changes from 8 commits
a9c5422
f771d8a
2734bf6
07b45cd
3f2d78e
cffc988
de4c285
510b9c6
8b37c7a
90da4f5
98495f6
fc22f12
cebeca5
2614743
668fa68
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
riroan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,4 +18,12 @@ public int getSize() { | |
| public Lotto get(int ix) { | ||
| return values.get(ix); | ||
| } | ||
|
|
||
|
Comment on lines
17
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 메서드는 view에서 사용하고 있는데요. 웹 환경이라면 해당 메서드는 호출 가능한가요?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. https://edu.nextstep.camp/s/MCLQmhAp/ls/DO2AJZZW 젤 아래에 |
||
| public Result scoreLottos(WinningNumber winningNumber) { | ||
| Result result = new Result(); | ||
| for (Lotto lotto : values) { | ||
| result.scoreLotto(lotto, winningNumber); | ||
| } | ||
| return result; | ||
| } | ||
riroan marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
+21
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. public Result scoreLottos(WinningNumber winningNumber) {
return new Result(
values.stream()
.map(it -> winningNumber.match(it))
.collect(Collectors.groupingBy(it -> it, Collectors.counting()))
);
}이런 방법도 있을 것 같아요. 이 경우 테스트는 더 유연해 지지 않을까요? 테스트 코드는 어떻게 변경될 수 있을까요? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Result.reward는 필드에 꼭 필요할까요? 내부 Map 에서 계산할 수 있지 않을까요? |
||
| } | ||
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.
lottoSystem의 역할은 무엇인가요? 메서드들을 보니 책임이 하나인 것 같지는 않아서요.
Uh oh!
There was an error while loading. Please reload this page.
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.
로또 플레이할 때 필요한 기능들을 모아둔 클래스입니다. 어떻게 쪼개야할 지 몰라서 한 클래스에 모두 들어간 느낌이네요..