-
Notifications
You must be signed in to change notification settings - Fork 358
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
🚀 3단계 - 로또(2등) #792
base: goyounggyeong
Are you sure you want to change the base?
🚀 3단계 - 로또(2등) #792
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.
안녕하세요!
3단계 구현 잘 해주셨네요!! 👍
몇가지 코멘트를 남겨놨으니 확인부탁드릴게요~~~
@@ -23,8 +23,9 @@ fun main() { | |||
printLottoNumber(purchasedLottos) |
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.
움 제가 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
보통 로또에서 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
지난주 리뷰에서 LottoNumber를 값객체로 wrapping하는 예시를 보여줬는데요! 이번에 값객체를 만들어보시면 어떨까요?
val lastWeekWinningNumbers: List<Int> = toIntList(lastWeekWinningString) | ||
purchasedLottos.forEach { it.setLottoPrize(lastWeekWinningNumbers) } | ||
purchasedLottos.forEach { it.setLottoPrize(lastWeekWinningNumbers, lastWeekBonusNumber) } |
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.
현재는 lastWeekWinningNumbers를 List로 넘겨주고 있지만, 해당 변수도 하나의 Lotto객체로 만들어보면 어떨까요??
WinningLotto와 같이 Lotto와 BonusNumber를 가지고 있는 객체를 만들어볼 수 있을것 같아요!
안녕하세요. 리뷰 잘 부탁드립니다. :)