-
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
[step4] 로또 (수동) #1123
base: sarahan774
Are you sure you want to change the base?
[step4] 로또 (수동) #1123
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.
안녕하세요!
step4까지 작성 잘해주셨네요 👍
몇가지 코멘트를 남겼으니 확인부탁드릴게요!
@@ -50,4 +50,15 @@ object LottoController { | |||
) | |||
return result | |||
} | |||
|
|||
private fun createMyLottoList(totalLottoCount: Int): List<Lotto> { | |||
val manualLottoCount = InputView.readManualLottoCount(InputView.ENTER_MANUAL_LOTTO_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.
InputView에 InputView의 메시지를 넣어주는 방식으로 변경하신 이유가 있을까요~?
프롬프트 메시지는 View의 영역이라고 생각해서요!
private fun readManualLotto(): List<Int> { | ||
val input = | ||
readlnOrNull()?.trim() | ||
?.split(",") |
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.
매직넘버가 보이네요 :)
val input = | ||
readlnOrNull()?.trim() | ||
?.split(",") | ||
?.map { it.trim().toIntOrNull() ?: 0 } |
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.
OrNull 이후에 throw가 아닌 0으로 결정하신 이유가 있을까요??
View에서 숫자가 아닌경우의 validation은 해줘도 되지 않을까싶어요!
promptMessage: String, | ||
count: Int, | ||
): List<List<Int>> { | ||
val manualLottoNumberList = mutableListOf<List<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.
https://tecoble.techcourse.co.kr/post/2020-04-24-variable_naming/
네이밍에 대해 고민해보고 List postfix를 붙이는 것에 대한 고민을 해보면 어떨까요?
} | ||
|
||
private fun autoGeneratedLottoList() = | ||
List(autoGeneratedLottoCount) { |
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.
autoGeneratedLottoCount가 음수가 될 확률은 없을까요!?
} | ||
} | ||
|
||
private fun autoGeneratedLottoList() = |
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.
중괄호 없이 단일 표현식으로 작성을 해주셨는데요!
단일 표현식으로 작성하시는 기준이 있을까요~?
@@ -23,8 +23,8 @@ object LottoController { | |||
// 총 구매 로또 개수 | |||
ResultView.printTotalPurchaseCount(totalLottoCount) | |||
|
|||
val myLottoList = createMyLottoList(totalLottoCount) |
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.
당첨번호라는 의미를 가진 변수인데, myLotto가 괜찮을기 고민 해보면 좋을 것 같아요 :)
@@ -1,4 +1,4 @@ | |||
package lotto.domain.model | |||
package lotto.domain | |||
|
|||
@JvmInline | |||
value class Lotto(val value: List<LottoNumber>) { |
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.
지금보니까 LottoTest가 없네요!! 테스트를 작성해보면 어떨까요?
피드백 미리 감사드립니다.