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단계 - λΈ”λž™μž­(λ”œλŸ¬) #653

Open
wants to merge 81 commits into
base: moto6
Choose a base branch
from

Conversation

moto6
Copy link

@moto6 moto6 commented Nov 23, 2023

μ•ˆλ…•ν•˜μ„Έμš” λ¦¬λ·°μ–΄λ‹˜! 3단계 λ―Έμ…˜ PR μš”μ²­λ“œλ¦½λ‹ˆλ‹€!

dong added 28 commits November 20, 2023 01:45
Copy link
Member

@malibinYun malibinYun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3단계 λ―Έμ…˜ 고생 λ§ŽμœΌμ…¨μ–΄μš”!
생각해보면 쒋을 점듀에 μ½”λ©˜νŠΈ λ‚¨κ²¨λ‘μ—ˆμŠ΅λ‹ˆλ‹€.
ν”Όλ“œλ°± 반영 ν›„ λ‹€μ‹œ 리뷰 μš”μ²­ λΆ€νƒλ“œλ €μš”!

Comment on lines 17 to 32
while (participants.isContinue()) {
playingBlackJack(participants)
}
OutputView.result(participants)
OutputView.presentScores(participants)
OutputView.presentResult(Referee.blackJackResult(participants))
}

fun playingBlackJack(participants: Participants) {
participants.participants.forEach {
it.hitOrStand()
participants.players.values.forEach {
it.playing(InputView.askHit(it), ShuffledPack)
}
when (participants.dealer.playing(DealerStrategy(participants.dealer.score()), ShuffledPack)) {
PlayableReaction.HIT -> println("λ”œλŸ¬λŠ” 16μ΄ν•˜λΌ ν•œμž₯의 μΉ΄λ“œλ₯Ό 더 λ°›μ•˜μŠ΅λ‹ˆλ‹€.")
PlayableReaction.STAND -> println("λ”œλŸ¬λŠ” 17이상이라 μΉ΄λ“œλ₯Ό 받지 μ•Šμ•˜μŠ΅λ‹ˆλ‹€.")
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

λΈ”λž™μž­ 룰이 잘 λ°˜μ˜λ˜μ–΄μžˆμ§€ μ•Šμ•„ λ³΄μ—¬μš”.
μ•„λž˜ 룰듀이 λ°˜μ˜λ˜μ–΄μžˆμ§€ μ•Šμ•„μ„œ, λΈ”λž™μž­ 룰을 λ‹€μ‹œ ν•œ 번 νŒŒμ•…ν•΄λ³΄μ‹  ν›„ ν”„λ‘œμ νŠΈμ— λ°˜μ˜ν•΄λ³΄λŠ” 건 μ–΄λ–¨κΉŒμš”?

  • ν”Œλ ˆμ΄μ–΄λŠ” Bust 되기 μ „κΉŒμ§€ Hitλ₯Ό ν•  수 μžˆλ‹€.
  • λ”œλŸ¬λŠ” ν”Œλ ˆμ΄μ–΄κ°€ λͺ¨λ‘ μ°¨λ‘€λ₯Ό μ§„ν–‰ν•œ λ’€ μΉ΄λ“œ 뽑기λ₯Ό μ§„ν–‰ν•œλ‹€.

src/main/kotlin/blackjack/Controller.kt Outdated Show resolved Hide resolved
@@ -40,7 +40,7 @@ class Cards(

companion object {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cards 객체λ₯Ό λΆˆλ³€ 객체둜 λ§Œλ“€μ–΄λ³΄λŠ” μ‹œλ„λ₯Ό 해보셔도 μ’‹κ² λ„€μš” πŸ™‚

src/main/kotlin/blackjack/model/Players.kt Outdated Show resolved Hide resolved
src/main/kotlin/blackjack/model/Referee.kt Outdated Show resolved Hide resolved
src/test/kotlin/blackjack/model/DealerTest.kt Outdated Show resolved Hide resolved
src/test/kotlin/blackjack/model/RefereeTest.kt Outdated Show resolved Hide resolved
Comment on lines 5 to 19
class ConsoleInputStrategy : PlayingStrategy {

override fun isHit(): Boolean {
println("ν”Œλ ˆμ΄μ–΄λŠ” ν•œμž₯의 μΉ΄λ“œλ₯Ό 더 λ°›κ² μŠ΅λ‹ˆκΉŒ?(μ˜ˆλŠ” y, μ•„λ‹ˆμ˜€λŠ” n)")
return this.isHitInput()
}

private fun isHitInput(): Boolean {
return (readlnOrNull() ?: "") == HIT_COMMAND
}

companion object {
private const val HIT_COMMAND: String = "y"
}
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 뢀뢄은 ν”Œλ ˆμ΄μ–΄κ°€ hit 인지, stand 인지 μ½˜μ†”λ‘œ μž…λ ₯을 λ°›μ•„λ“€μ΄λŠ” λΆ€λΆ„μΈλ°μš”, λ„μ €νžˆ 이뢀뢄을 view 클래슀둜 λΆ„λ¦¬ν•΄λ‚Όμˆ˜κ°€ μ—†μ–΄μ„œ 정책에 κ²©λ¦¬ν•΄λ‘μ—ˆμŠ΅λ‹ˆλ‹€.

μ½”λ“œμ μœΌλ‘œλŠ” print, readln 등이 μžˆμ–΄ view λ ˆμ΄μ–΄μ— μœ„μΉ˜ν•΄μ•Όν• κΊΌκ°™λ‹€κ³  μƒκ°λ˜λŠ”λ°μš”,

ν•΄λ‹Ή λΆ€λΆ„μ—μ„œ view λ ˆμ΄μ–΄λ₯Ό μ°Έμ‘°ν•˜λŠ”κ²ƒλ„ μ•ˆμ’‹μ€ λ°©λ²•μ΄λΌμ„œ 일단 μ΄λ ‡κ²Œ μž‘μ„±ν•΄λ‘μ—ˆμŠ΅λ‹ˆλ‹€!

@moto6
Copy link
Author

moto6 commented Nov 26, 2023

아직 ν•΄κ²°ν•˜μ§€ λͺ»ν•œ λΆ€λΆ„

  • 치λͺ…적인 버그가 μžˆλŠ”λ°μš” μ•„λž˜μ˜ μŠ€ν¬λ¦°μƒ·κ³Ό 같이 ν”Œλ ˆμ΄μ–΄κ°€ burst 둜 νŒ¨λ°°ν•œ μƒν™©μ—μ„œ WIN 으둜 κ²°κ³Όκ°€ λ‚˜μ˜€κ³  μžˆμŠ΅λ‹ˆλ‹€.
    • ν•΄λ‹ΉλΆ€λΆ„ 원인을 μ°ΎκΈ°μœ„ν•΄ 디버깅도 ν•˜κ³ , ν…ŒμŠ€νŠΈμ½”λ“œλ„ μΆ”κ°€ν–ˆλŠ”λ°, 아직 ν•΄κ²°λ˜μ§€ μ•Šμ•„μ„œ μ½”λ©˜νŠΈ λ‚¨κ²¨λ‘κ² μŠ΅λ‹ˆλ‹€!(λΉ λ₯Έμ‹œμΌλ‚΄μ—, ν˜Ήμ€ λ‹€μŒ λ―Έμ…˜κΉŒμ§€ ν•΄κ²°ν•˜κ² μŠ΅λ‹ˆλ‹€!
image

@moto6
Copy link
Author

moto6 commented Nov 26, 2023

ν”Όλ“œλ°± μ£Όμ‹  뢀뢄인 #653 (comment) << ν•΄λ‹Ή 뢀뢄을 κ²€μ¦ν•˜κΈ° μœ„ν•΄μ„œ νƒˆλ½ν•œ ν”Œλ ˆμ΄μ–΄λŠ” μΉ΄λ“œλ₯Ό 뽑을 κΈ°νšŒκ°€ 주어지지 μ•Šκ³  μ΅œν›„μ˜ ν”Œλ ˆμ΄μ–΄κ°€ λ‚¨μ•„μ„œ μΉ΄λ“œλ₯Ό 뽑을 수 μžˆμ„λ•ŒκΉŒμ§€ κ²½κΈ°λ₯Ό μ§„ν–‰ν•˜λ„λ‘ μˆ˜μ •ν•˜μ˜€μŠ΅λ‹ˆλ‹€!

image

Copy link
Member

@malibinYun malibinYun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

μ§€κΈˆ ν”Œλ ˆμ΄λ‘œλŠ” μΉ΄λ“œ ν•œ μž₯ 더 λ°›μ•˜μ„ λ•Œ ν˜„μž¬ 가진 μΉ΄λ“œ λͺ©λ‘μ΄ ν‘œμ‹œλ˜κ³  μžˆμ§€ μ•Šμ•„ μ›ν™œν•œ ν”Œλ ˆμ΄κ°€ λΆˆκ°€λŠ₯ν•΄λ³΄μ—¬μš”!
μΉ΄λ“œλ₯Ό
또, 말씀해주신 λŒ€λ‘œ Burst μƒνƒœμž„μ—λ„ Win μƒνƒœκ°€ λ‚˜μ˜€κ³  μžˆλŠ” 것을 저도 직접 μ‹€ν–‰ν•΄λ³΄λ©΄μ„œ μ•Œκ²Œλ˜μ—ˆμ–΄μš”!

λ¨Όμ € λ―Έμ…˜ μš”κ΅¬μ‚¬ν•­μ— 맞게 κ²Œμž„μ„ 진행할 수 μžˆλŠ” ν˜•νƒœλ‘œ λ§Œλ“€μ–΄λ³΄μ‹  ν›„, λ‹€μ‹œ 리뷰 μš”μ²­ λΆ€νƒλ“œλ €μš”! πŸ™‚πŸ’ͺ

dong added 17 commits November 27, 2023 23:51
@moto6
Copy link
Author

moto6 commented Nov 27, 2023

μ•ˆλ…•ν•˜μ„Έμš”! ν”Όλ“œλ°± μ£Όμ‹  λΆ€λΆ„ μˆ˜μ •μ™„λ£Œν–ˆκ³  λ²„κ·ΈκΉŒμ§€ μˆ˜μ •μ™„λ£Œ ν•˜μ˜€μŠ΅λ‹ˆλ‹€!!
image

Copy link
Member

@malibinYun malibinYun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DM 문의 μ£Όμ‹ λŒ€λ‘œ, λΈ”λž™μž­ 룰에 λŒ€ν•΄ μ™„μ „νžˆ λ°˜μ˜ν•˜κΈ° μœ„ν•΄ request change κ±Έμ–΄λ‘˜κ²Œμš”!
룰에 λŒ€ν•΄ μ™„μ „νžˆ λ°˜μ˜λ˜μ‹ λ‹€λ©΄ λ‹€μ‹œ 리뷰 μš”μ²­ λΆ€νƒλ“œλ €μš”! πŸ’ͺ

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

2 participants