Open
Conversation
vsh123
requested changes
Jul 2, 2023
vsh123
left a comment
There was a problem hiding this comment.
안녕하세요!
3단계 구현 잘 해주셨네요!! 👍
몇가지 코멘트를 남겨놨으니 확인부탁드릴게요~~~
| @@ -23,8 +23,9 @@ fun main() { | |||
| printLottoNumber(purchasedLottos) | |||
There was a problem hiding this comment.
움 제가 2단계에서 피드백 드리지 못한부분이 있어서 요기에 남길게요!!
- COMMA_SEPARATOR가 LottoPlay에 위치할 이유가 있을까요? StringUtil에서만 사용되는 것 같아요!
- purchasedLottos는 MutableList가 아니라 List여도 충분할 것 같아요 :)
|
|
||
| fun setLottoPrize(lastWeekWinningNumbers: List<Int>, lastWeekBonusNumber: Int): LottoPrize { | ||
| val matchingNumbers = match(lastWeekWinningNumbers) | ||
| val bonusBallMatching: Int = |
There was a problem hiding this comment.
- Boolean타입이여도 충분하지 않을까요?
- 해당변수에만 리턴값을 명시하신 이유가 있을까요?
| NONE_PRIZE(0, 0); | ||
| enum class LottoPrize(val matchingCount: Int, val bonusMatching: Int = 0, val prizeAmount: Long) { | ||
| FIRST(6, 0, 2000000000), | ||
| BONUS(5, 1, 30000000), |
There was a problem hiding this comment.
보통 로또에서 2등을 5개 일치 + 보너스 일치로 이야기하는데요! 해당 enum의 값이 BONUS가 되어야하지 않을까요?
| @@ -4,14 +4,23 @@ class Lotto { | |||
| var lottoPrize: LottoPrize = LottoPrize.NONE_PRIZE | |||
| val purchasedLottoNumbers: List<Int> = LOTTO_NUMBERS.shuffled().take(LOTTO_NUMBER_COUNT).sorted() | |||
There was a problem hiding this comment.
지난주 리뷰에서 LottoNumber를 값객체로 wrapping하는 예시를 보여줬는데요! 이번에 값객체를 만들어보시면 어떨까요?
| val lastWeekBonusNumber = LottoVendor.readLastWeekBonusBallNumber() | ||
| val lastWeekWinningNumbers: List<Int> = toIntList(lastWeekWinningString) | ||
| purchasedLottos.forEach { it.setLottoPrize(lastWeekWinningNumbers) } | ||
| purchasedLottos.forEach { it.setLottoPrize(lastWeekWinningNumbers, lastWeekBonusNumber) } |
There was a problem hiding this comment.
현재는 lastWeekWinningNumbers를 List로 넘겨주고 있지만, 해당 변수도 하나의 Lotto객체로 만들어보면 어떨까요??
WinningLotto와 같이 Lotto와 BonusNumber를 가지고 있는 객체를 만들어볼 수 있을것 같아요!
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.
안녕하세요. 리뷰 잘 부탁드립니다. :)