Skip to content

[πŸš€ 사이클2 - λ―Έμ…˜ (λΈ”λž™μž­ λ² νŒ…)] 에버 λ―Έμ…˜ μ œμΆœν•©λ‹ˆλ‹€.#1102

Merged
pci2676 merged 101 commits intowoowacourse:chocoding1from
Chocoding1:Chocoding1
Mar 18, 2026
Merged

[πŸš€ 사이클2 - λ―Έμ…˜ (λΈ”λž™μž­ λ² νŒ…)] 에버 λ―Έμ…˜ μ œμΆœν•©λ‹ˆλ‹€.#1102
pci2676 merged 101 commits intowoowacourse:chocoding1from
Chocoding1:Chocoding1

Conversation

@Chocoding1
Copy link

@Chocoding1 Chocoding1 commented Mar 13, 2026

체크 리슀트

  • λ―Έμ…˜μ˜ ν•„μˆ˜ μš”κ΅¬μ‚¬ν•­μ„ λͺ¨λ‘ κ΅¬ν˜„ν–ˆλ‚˜μš”?
  • Gradle testλ₯Ό μ‹€ν–‰ν–ˆμ„ λ•Œ, λͺ¨λ“  ν…ŒμŠ€νŠΈκ°€ μ •μƒμ μœΌλ‘œ ν†΅κ³Όν–ˆλ‚˜μš”?
  • μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ΄ μ •μƒμ μœΌλ‘œ μ‹€ν–‰λ˜λ‚˜μš”?

μ–΄λ–€ 뢀뢄에 μ§‘μ€‘ν•˜μ—¬ 리뷰해야 ν• κΉŒμš”?

TDD

TDDλ₯Ό μ‹œλ„ν•΄ 보렀고 ν•˜λ‹ˆ, 처음 ν…ŒμŠ€νŠΈ 파일의 이름을 μ •ν•˜λŠ” 것뢀터 λ§‰νžˆλŠ” κ²½ν—˜μ„ ν–ˆμŠ΅λ‹ˆλ‹€. TDDλ₯Ό μœ„ν•΄ κ°€μž₯ λ‹¨μˆœν•œ λ‘œμ§μ„ λ¨Όμ € ν…ŒμŠ€νŠΈν•˜κΈ° μœ„ν•΄μ„œλŠ” κ·Έ 둜직이 μ–΄λ–€ 객체에 μ‘΄μž¬ν•΄μ•Ό ν•˜λŠ”μ§€ λ¨Όμ € μ •ν•΄μ•Ό ν•˜λŠ” κ±΄κ°€μš”? λ§Œμ•½ κ·Έλ ‡λ‹€λ©΄ TDD둜 κ°œλ°œμ„ μ‹œμž‘ν•˜κΈ° 전에 전체 μ„œλΉ„μŠ€μ˜ 섀계λ₯Ό μ™„λ²½ν•˜κ²Œ 해놓아야 ν•˜λŠ”μ§€ κΆκΈˆν•©λ‹ˆλ‹€.

초기 섀계

μ΄ˆκΈ°μ— μ„€κ³„ν•˜μ‹€ λ•Œ μ–΄λ–€ νλ¦„μœΌλ‘œ μ–΄λ–€ 객체듀이 ν•„μš”ν• μ§€ μ •ν•˜μ‹œλŠ”μ§€ κΆκΈˆν•©λ‹ˆλ‹€.

λ¦¬νŒ©ν† λ§

μ΄λ²ˆμ— λ°°νŒ… 수읡금 계산 κΈ°λŠ₯을 μΆ”κ°€ν•˜λŠ” κ³Όμ •μ—μ„œ λ§Žμ€ λ¦¬νŒ©ν† λ§μ΄ ν•„μš”ν–ˆμŠ΅λ‹ˆλ‹€. ν•œ λ²ˆμ— λ§Žμ€ ν΄λž˜μŠ€λ“€μ΄ κΌ¬μ—¬μžˆλ‹€ λ³΄λ‹ˆ μ–΄λ””μ„œλΆ€ν„° ν’€μ–΄λ‚˜κ°€μ•Ό ν• μ§€ 감을 λͺ» μž‘μ•˜λŠ”λ°μš”, μ΄λ ‡κ²Œ λ³΅μž‘ν•˜κ²Œ 꼬인 μ½”λ“œλ“€μ„ ν’€ λ•ŒλŠ” μ–΄λ–€ λ°©μ‹μœΌλ‘œ μ ‘κ·Όν•˜λŠ” 것이 μ’‹μ„κΉŒμš”?

khyej and others added 30 commits March 5, 2026 11:59
Copy link

@pci2676 pci2676 left a comment

Choose a reason for hiding this comment

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

μ „μ²΄μ μœΌλ‘œ 리뷰 반영이 κΉ”λ”ν•˜μ‹œλ„€μš”

dm으둜 이야기λ₯Ό λ§Žμ΄ν•΄μ„œ κ·ΈλŸ°μ§€ μ½”λ“œμ—μ„œ 고민의 흔적이 잘 λ³΄μ΄λŠ”κ²ƒ κ°™λ„€μš” πŸ‘

도전해보면 쒋을 뢀뢄에 리뷰λ₯Ό λ‚¨κ²¨λ‘μ—ˆμœΌλ‹ˆ ν™•μΈν•΄μ£Όμ„Έμš”

Comment on lines +51 to +61
public GameResult judge(User user) {
if (this.isBust() || user.isBust()) {
return judgeByBust();
}

if (this.isBlackjack() || user.isBlackjack()) {
return judgeByBlackjack(user);
}

return judgeByScore(user);
}
Copy link

Choose a reason for hiding this comment

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

이 λΆ€λΆ„ 둜직이 μ•„λ¬΄λž˜λ„ λ³΅μž‘ν•˜λ‹€ λ³΄λ‹ˆ private λ©”μ„œλ“œ ν˜ΈμΆœμ„ 많이 ν•˜κ³ μžˆλŠ”λ°μš”

μƒνƒœνŒ¨ν„΄μ„ μ΄μš©ν•΄μ„œ handλ₯Ό ν‘œν˜„ν•΄λ³΄λ©΄ μ–΄λ–¨κΉŒμš”? 잘 ν•΄λ³Έλ‹€λ©΄ 쑰금 더 κ°„κ²°ν•˜κ²Œ ν‘œν˜„ν•΄λ³Ό 수 μžˆμ„κ²ƒ κ°™μ•„μš”

cardProvider.provideInitCards(users);
}

public void hitPlayers(List<User> users, Function<User, String> readHitCommand,
Copy link

Choose a reason for hiding this comment

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

ꡳ이 λ°˜μ˜μ€ ν•˜μ‹œμ§€ μ•Šμ•„λ„ λ˜λŠ”λ°μš”

μœ„μ™€ 같은 λΆ€λΆ„μ—μ„œ λ§€κ°œλ³€μˆ˜κ°€ 많이 μ „λ‹¬λ˜κ³ μžˆλŠ”λ° λ§€κ°œλ³€μˆ˜μ˜ 수λ₯Ό 쀄이도둝 λ³„λ„μ˜ 콜백 전달 객체λ₯Ό κ³ λ €ν•΄λ³΄μ‹œλŠ”κ²ƒλ„ 쒋을것 κ°™μ•„μš”.

각 μ½œλ°±λ“€μ΄ μ–΄λ–€ 유기적 μƒν˜Έκ΄€κ³„λ₯Ό κ°–κ²Œλ˜λŠ”μ§€ μ‹œκ·Έλ‹ˆμ²˜λ§Œ 보면 잘 νŒŒμ•…μ΄ λ˜μ§€ μ•Šμ•„μ„œμš”

그리고 Usersλ₯Ό λ„˜κΈ°κ³  λ‚΄λΆ€μ—μ„œ playersλ₯Ό ν•„ν„°λ§ν•˜κ²Œν•œλ‹€λ©΄ 더 μ•ˆμ „ν•˜μ§€ μ•Šμ„κΉŒμš”?

Copy link

@kang-hyungu kang-hyungu left a comment

Choose a reason for hiding this comment

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

에버 λͺ‡κ°€μ§€ ν”Όλ“œλ°± λ‚¨κ²ΌμœΌλ‹ˆ μ°Έκ³ ν•˜μ„Έμš”
κΆκΈˆν•œ 점 있으면 μ§ˆλ¬Έμ£Όμ„Έμš”~

import java.util.List;


public class BlackjackController {

Choose a reason for hiding this comment

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

μ»¨νŠΈλ‘€λŸ¬κ°€ 뭐죠? μ™œ 이름이 컨트둀러죠?


static final String ERROR_EMPTY_INPUT = "μž…λ ₯값은 곡백일 수 μ—†μŠ΅λ‹ˆλ‹€.";
static final String ERROR_BET_AMOUNT_NOT_INTEGER = "λ°°νŒ… κΈˆμ•‘μ€ 숫자 ν˜•νƒœλ‘œ μž…λ ₯ν•΄μ•Ό ν•©λ‹ˆλ‹€ : %s";
static final String ERROR_BET_AMOUNT_NOT_POSITIVE = "λ°°νŒ… κΈˆμ•‘μ€ 1원 이상이어야 ν•©λ‹ˆλ‹€ : %d";

Choose a reason for hiding this comment

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

κ²Œμž„ κ·œμΉ™μ΄ λ°”κ»΄μ„œ λ°°νŒ… κΈˆμ•‘μ„ 1원이 μ•„λ‹Œ 10원 μ΄μƒμœΌλ‘œ λ°”κΏ”μ•Όν•œλ‹€λ©΄?
ν…μŠ€νŠΈλ‘œλ§Œ μœ μ§€ν•˜λ©΄ μˆ˜μ • 사항이 생길 λ•Œλ§ˆλ‹€ λͺ¨λ“  λ¬Έμžμ—΄μ„ 직접 μ°Ύμ•„μ„œ λ°”κΏ”μ•Όκ² κ΅°μš”?

import java.util.Queue;
import java.util.stream.Collectors;

public class CardProvider {

Choose a reason for hiding this comment

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

provider라고 이름 지은 μ΄μœ κ°€ λ­”κ°€μš”?

public class CardProvider {

private static final int INIT_CARDS_START_IDX = 0;
private static final int INIT_CARDS_END_IDX = 2;

Choose a reason for hiding this comment

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

idx μ•½μ–΄ κΈˆμ§€

}
}
List<Card> cards = Arrays.stream(Rank.values())
.flatMap(rank -> Arrays.stream(Suit.values())

Choose a reason for hiding this comment

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

stream μ•ˆμ—μ„œ 또 stream을 μ²˜λ¦¬ν•˜λ©΄ μ½”λ“œκ°€ λ³΅μž‘ν•΄μ§‘λ‹ˆλ‹€
λ©”μ„œλ“œλ‘œ μΆ”μΆœν•΄μ„œ μ½”λ“œ 읽기 μ’‹κ²Œ λ°”κΏ”λ³΄μ„Έμš”


import blackjack.model.bet.BetAmount;

public enum GameResult {

Choose a reason for hiding this comment

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

μ μ ˆν•œ 클래슀λͺ…μΈκ°€μš”?
이 ν΄λž˜μŠ€κ°€ 맑은 일은 λ¬΄μ—‡μΈκ°€μš”?

}

@Override
public boolean isPlayer() {

Choose a reason for hiding this comment

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

Userλ₯Ό μƒμ†ν•΄μ„œ Player 객체둜 μ„ μ–Έν–ˆλŠ”λ°, κ·Έ νƒ€μž…μ„ 또 μ²΄ν¬ν•˜λŠ” λ©”μ„œλ“œλ₯Ό λ‘μ—ˆλ‹€λŠ”κ²Œ μ–΄μƒ‰ν•˜κ²Œ λŠκ»΄μ§€λ„€μš”
νƒ€μž…μ„ ν™œμš©ν•˜κ±°λ‚˜ 섀계λ₯Ό λ‹€μ‹œ κ³ λ―Όν•΄λ΄μ•Όν•˜μ§€ μ•Šμ„κΉŒμš”?
μ§€κΈˆμ€ λ”œλŸ¬, ν”Œλ ˆμ΄μ–΄λ§Œ μžˆμ§€λ§Œ μƒˆλ‘œμš΄ κ²Œμž„ κ·œμΉ™μ΄ μƒκ²¨μ„œ μƒˆλ‘œμš΄ userκ°€ μΆ”κ°€λœλ‹€λ©΄ 그땐 또 λ‹€λ₯Έ isXXX μ‹œλ¦¬μ¦ˆκ°€ 계속 생길 수 μžˆκ² λ„€μš”

}

public abstract boolean isHitAvailable();
public GameResult judge(User user) {

Choose a reason for hiding this comment

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

judge λ©”μ„œλ“œλͺ… μ μ ˆν•œκ°€μš”?
κ²Œμž„ μš©μ–΄λ‘œ 바꿔보면 μ–΄λ–¨κΉŒμš”?

@@ -11,8 +11,13 @@ public static String readPlayerName() {
return sc.nextLine();

Choose a reason for hiding this comment

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

μ•½μ–΄ κΈˆμ§€μž…λ‹ˆλ‹€


public class OutputView {

private static final int BLACKJACK_SCORE = 21;

Choose a reason for hiding this comment

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

κ²Œμž„ κ·œμΉ™μ— ν•΄λ‹Ήν•˜λŠ” μƒμˆ˜λ₯Ό viewμ—μ„œ μ²˜λ¦¬ν•˜λŠ” μ΄μœ κ°€ μžˆμ„κΉŒμš”

Copy link

@pci2676 pci2676 left a comment

Choose a reason for hiding this comment

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

μƒνƒœνŒ¨ν„΄ 적절히 κ΅¬ν˜„ν•΄μ£Όμ…¨λ„€μš”

λΈ”λž™μž­μ€ μ—¬κΈ°μ„œ λ§ˆλ¬΄λ¦¬ν•΄λ„ 쒋을것 κ°™μŠ΅λ‹ˆλ‹€

남은 λ―Έμ…˜λ“€λ„ 건투λ₯Ό λΉŒκ² μŠ΅λ‹ˆλ‹€.

mergeν•˜κ² μŠ΅λ‹ˆλ‹€. πŸš€

Comment on lines +16 to +17
return this;
// throw new IllegalStateException("λ²„μŠ€νŠΈ μƒνƒœμ—μ„œλŠ” μΉ΄λ“œλ₯Ό μΆ”κ°€λ‘œ 받을 수 μ—†μŠ΅λ‹ˆλ‹€.");
Copy link

Choose a reason for hiding this comment

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

μ–΄λ–€κ²Œ μ˜λ„ν•˜μ‹œλŠ” λ°©ν–₯μΌκΉŒμš”?

import blackjack.model.card.Hand;
import blackjack.model.gameresult.GameResult;

public interface HandState {
Copy link

Choose a reason for hiding this comment

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

πŸ‘

@pci2676 pci2676 merged commit cf120f8 into woowacourse:chocoding1 Mar 18, 2026
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.

4 participants