Skip to content
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

Open
wants to merge 1 commit into
base: goyounggyeong
Choose a base branch
from

Conversation

goyounggyeong
Copy link

์•ˆ๋…•ํ•˜์„ธ์š”. ๋ฆฌ๋ทฐ ์ž˜ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค. :)

Copy link

@vsh123 vsh123 left a 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)
Copy link

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 =
Copy link

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),
Copy link

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()
Copy link

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) }
Copy link

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๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ๊ฐ์ฒด๋ฅผ ๋งŒ๋“ค์–ด๋ณผ ์ˆ˜ ์žˆ์„๊ฒƒ ๊ฐ™์•„์š”!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants