Skip to content

Step2: 블랙잭 구현 #667

Open
baek0318 wants to merge 12 commits intonext-step:baek0318from
baek0318:step2
Open

Step2: 블랙잭 구현 #667
baek0318 wants to merge 12 commits intonext-step:baek0318from
baek0318:step2

Conversation

@baek0318
Copy link
Copy Markdown

잘 부탁 드립니다

Copy link
Copy Markdown

@wlsdnjs829 wlsdnjs829 left a comment

Choose a reason for hiding this comment

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

안녕하세요, 승화님😊
블랙잭의 첫 시작을 잘 해 주셨네요. 👏🏾
요구사항 몇 개 수정되면 좋을 거 같아, 코멘트로 남겨드렸습니다.
확인 후 다시 PR 요청 부탁드립니다. 궁금한 부분은 언제든 DM 주세요. 👍🏽

Comment on lines +5 to +9
return when (input) {
"y" -> true
"n" -> false
else -> throw IllegalArgumentException("올바른 입력을 해주세요")
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

p3; view의 영역이라도 적절한 객체로 관리하면 어떨까요?


class ListCardDeck(
private val cards: MutableList<Card>
): CardDeck {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

p3; 클래스 정렬이 되어 있지 않은 거 같아요.

}

fun stop(): Int {
return ScoreCalculator.calc(cards)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

p2; stop이라는 메서드에서 계산까지 해주는 형태네요. 플레이어가 ScoreCalculator를 알아야 할지 고민해 보면 좋을 거 같아요.

Comment on lines +3 to +7
class RandomCardDeck: CardDeck {
override fun drawCard(): Card {
return Card.values().random()
}
} No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

p1; 카드덱은 정해져 있고, 그 과정에서 랜덤하게 나와야 할 거 같은데 이 구조라면 A(다이아), A(다이아), A(다이아)... 처럼 동일한 카드와 형태를 받을 수도 있을 거 같아요.

Comment on lines +3 to +9
## 요구사항
- 카드의 숫자 계산은 카드 숫자를 기본으로 하며
- Ace는 1 또는 11로 계산할 수 있으며
- King, Queen, Jack은 각각 10으로 계산한다.
- 게임을 시작하면 플레이어는 두 장의 카드를 지급 받으며
- 두 장의 카드 숫자를 합쳐 21을 초과하지 않으면서 21에 가깝게 만들면 이긴다.
- 21을 넘지 않을 경우 원한다면 얼마든지 카드를 계속 뽑을 수 있다. No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

p1; 프로그래밍 요구사항이 몇 가지 지켜지지 않은 부분들이 있습니다.

  • ACE가 21을 넘지 않는 경우 16이 아닌 7로 계산되는 점
  • 21을 초과했음에도 카드를 계속 받겠냐는 문구
  • 각 카드 뭉치의 suit(다이아, 스페이스, 하트, 클로버)가 나누어 있지 않는 점

다음 요구사항을 확인하고, 다시 PR 요청 부탁드리겠습니다. 💪🏽

image

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.

2 participants