-
Notifications
You must be signed in to change notification settings - Fork 313
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
base: moto6
Are you sure you want to change the base?
Conversation
Par<Suit,Rank> λ₯Ό Tramp λ‘ μμ
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λ¨κ³ λ―Έμ
κ³ μ λ§μΌμ
¨μ΄μ!
μκ°ν΄λ³΄λ©΄ μ’μ μ λ€μ μ½λ©νΈ λ¨κ²¨λμμ΅λλ€.
νΌλλ°± λ°μ ν λ€μ 리뷰 μμ² λΆνλλ €μ!
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μ΄μμ΄λΌ μΉ΄λλ₯Ό λ°μ§ μμμ΅λλ€.") | ||
} | ||
} |
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.
λΈλμ λ£°μ΄ μ λ°μλμ΄μμ§ μμ 보μ¬μ.
μλ λ£°λ€μ΄ λ°μλμ΄μμ§ μμμ, λΈλμ λ£°μ λ€μ ν λ² νμ
ν΄λ³΄μ ν νλ‘μ νΈμ λ°μν΄λ³΄λ 건 μ΄λ¨κΉμ?
- νλ μ΄μ΄λ Bust λκΈ° μ κΉμ§ Hitλ₯Ό ν μ μλ€.
- λλ¬λ νλ μ΄μ΄κ° λͺ¨λ μ°¨λ‘λ₯Ό μ§νν λ€ μΉ΄λ λ½κΈ°λ₯Ό μ§ννλ€.
@@ -40,7 +40,7 @@ class Cards( | |||
|
|||
companion object { |
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.
Cards κ°μ²΄λ₯Ό λΆλ³ κ°μ²΄λ‘ λ§λ€μ΄λ³΄λ μλλ₯Ό ν΄λ³΄μ λ μ’κ² λ€μ π
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" | ||
} | ||
} |
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.
μ΄ λΆλΆμ νλ μ΄μ΄κ° hit μΈμ§, stand μΈμ§ μ½μλ‘ μ λ ₯μ λ°μλ€μ΄λ λΆλΆμΈλ°μ, λμ ν μ΄λΆλΆμ view ν΄λμ€λ‘ λΆλ¦¬ν΄λΌμκ° μμ΄μ μ μ± μ 격리ν΄λμμ΅λλ€.
μ½λμ μΌλ‘λ print, readln λ±μ΄ μμ΄ view λ μ΄μ΄μ μμΉν΄μΌν κΊΌκ°λ€κ³ μκ°λλλ°μ,
ν΄λΉ λΆλΆμμ view λ μ΄μ΄λ₯Ό μ°Έμ‘°νλκ²λ μμ’μ λ°©λ²μ΄λΌμ μΌλ¨ μ΄λ κ² μμ±ν΄λμμ΅λλ€!
νΌλλ°± μ£Όμ λΆλΆμΈ #653 (comment) << ν΄λΉ λΆλΆμ κ²μ¦νκΈ° μν΄μ νλ½ν νλ μ΄μ΄λ μΉ΄λλ₯Ό λ½μ κΈ°νκ° μ£Όμ΄μ§μ§ μκ³ μ΅νμ νλ μ΄μ΄κ° λ¨μμ μΉ΄λλ₯Ό λ½μ μ μμλκΉμ§ κ²½κΈ°λ₯Ό μ§ννλλ‘ μμ νμμ΅λλ€! |
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.
μ§κΈ νλ μ΄λ‘λ μΉ΄λ ν μ₯ λ λ°μμ λ νμ¬ κ°μ§ μΉ΄λ λͺ©λ‘μ΄ νμλκ³ μμ§ μμ μνν νλ μ΄κ° λΆκ°λ₯ν΄λ³΄μ¬μ!
μΉ΄λλ₯Ό
λ, λ§μν΄μ£Όμ λλ‘ Burst μνμμλ Win μνκ° λμ€κ³ μλ κ²μ μ λ μ§μ μ€νν΄λ³΄λ©΄μ μκ²λμμ΄μ!
λ¨Όμ λ―Έμ μꡬμ¬νμ λ§κ² κ²μμ μ§νν μ μλ ννλ‘ λ§λ€μ΄λ³΄μ ν, λ€μ 리뷰 μμ² λΆνλλ €μ! ππͺ
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.
DM λ¬Έμ μ£Όμ λλ‘, λΈλμ λ£°μ λν΄ μμ ν λ°μνκΈ° μν΄ request change κ±Έμ΄λκ²μ!
λ£°μ λν΄ μμ ν λ°μλμ λ€λ©΄ λ€μ 리뷰 μμ² λΆνλλ €μ! πͺ
μλ νμΈμ 리뷰μ΄λ! 3λ¨κ³ λ―Έμ PR μμ²λ립λλ€!