Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
bf3e08e
refactor: ErrorMessage ์ œ๊ฑฐ ๋ฐ ์˜ˆ์™ธ ๋ฉ”์‹œ์ง€ ์ธ๋ผ์ธํ™” (์‚ฌ์ดํด 1 ํ”ผ๋“œ๋ฐฑ ๋ฐ˜์˜)
Yeji-Kim-Erica Mar 14, 2026
7f9f7b6
refactor: ์ปจํŠธ๋กค๋Ÿฌ ์บก์Аํ™” ๋ฐ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€ ์ถœ๋ ฅ ํฌ๋งท ์ค‘์•™ํ™”
Yeji-Kim-Erica Mar 14, 2026
88f6547
docs: ๋ธ”๋ž™์žญ ๊ฒŒ์ž„ ๋ฐฐํŒ… ๊ธฐ๋Šฅ ์š”๊ตฌ์‚ฌํ•ญ ๋ฐ ๋„๋ฉ”์ธ ๊ทœ์น™ ๋ช…์„ธ ์ถ”๊ฐ€ (์‚ฌ์ดํด 2)
Yeji-Kim-Erica Mar 14, 2026
a2a605c
docs: ๋ฐฐํŒ… ๊ธˆ์•ก ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ์˜ ์ฑ…์ž„ ์žฌ๋ถ„๋ฅ˜
Yeji-Kim-Erica Mar 14, 2026
a2c3fcd
docs: Ace ์นด๋“œ ์ ์ˆ˜ ๊ณ„์‚ฐ ๋„๋ฉ”์ธ ๊ทœ์น™ ๋ช…์„ธํ™”
Yeji-Kim-Erica Mar 14, 2026
d87d40b
feat: Cards ๋„๋ฉ”์ธ์˜ ์นด๋“œ ์ถ”๊ฐ€ ์ œํ•œ ๊ธฐ๋Šฅ ์ถ”๊ฐ€
Yeji-Kim-Erica Mar 14, 2026
45abe83
docs: ์นด๋“œ ์ค‘๋ณต ์ถ”๊ฐ€ ๋ฐฉ์ง€ ๋„๋ฉ”์ธ ๊ทœ์น™ ๋ช…์„ธ ์ถ”๊ฐ€
Yeji-Kim-Erica Mar 14, 2026
a1648e6
feat(Cards): ์ค‘๋ณต ์นด๋“œ ์ถ”๊ฐ€ ๋ฐฉ์ง€ ๊ธฐ๋Šฅ ์ถ”๊ฐ€
Yeji-Kim-Erica Mar 14, 2026
1b1c706
feat(Dealer): ์นด๋“œ ์ถ”๊ฐ€ ๋ฐฉ์ง€ ๊ธฐ๋Šฅ ๊ตฌํ˜„
Yeji-Kim-Erica Mar 14, 2026
e22a93e
feat(GameResult): ๋”œ๋Ÿฌ ์ƒํƒœ์— ๋”ฐ๋ฅธ ๊ฒฐ๊ณผ ๊ณ„์‚ฐ ๋ฐฉ์ง€ ๊ธฐ๋Šฅ ์ถ”๊ฐ€
Yeji-Kim-Erica Mar 14, 2026
1966578
refactor: ๋ฐฉ์–ด์  ๋ณต์‚ฌ ๋ฐฉ์‹ ๋ณ€๊ฒฝ์„ ํ†ตํ•ด ๋ถˆ๋ณ€์„ฑ ๊ฐ•ํ™”
Yeji-Kim-Erica Mar 14, 2026
144eb8c
feat(BetMoney): ๋ฐฐํŒ… ๊ธˆ์•ก ๋„๋ฉ”์ธ ๊ทœ์น™ ๊ฒ€์ฆ ๊ธฐ๋Šฅ ์ถ”๊ฐ€
Yeji-Kim-Erica Mar 14, 2026
c19e80f
feat(InputView): ๋ฐฐํŒ… ๊ธˆ์•ก ์‚ฌ์šฉ์ž ์ž…๋ ฅ๊ฐ’ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ๊ธฐ๋Šฅ ์ถ”๊ฐ€
Yeji-Kim-Erica Mar 14, 2026
74e7c45
feat: ๊ฐ ํ”Œ๋ ˆ์ด์–ด์—๊ฒŒ ๋ฐฐํŒ… ๊ธˆ์•ก์„ ์ž…๋ ฅ๋ฐ›๋Š” ๊ธฐ๋Šฅ ์ถ”๊ฐ€
Yeji-Kim-Erica Mar 14, 2026
9949fac
feat: ์ผ๋ฐ˜ ์ŠนํŒจ ๊ฒฐ๊ณผ์— ๋”ฐ๋ฅธ ์ตœ์ข… ์ˆ˜์ต ๊ณ„์‚ฐ, ๊ฒฐ๊ณผ ์ถœ๋ ฅ ๊ธฐ๋Šฅ ๊ตฌํ˜„
Yeji-Kim-Erica Mar 14, 2026
001e3a3
feat: ํŠน์ˆ˜ ์กฐ๊ฑด(๋ธ”๋ž™์žญ)์— ๋”ฐ๋ฅธ ์ตœ์ข… ์ˆ˜์ต ๊ณ„์‚ฐ ๊ธฐ๋Šฅ ๊ตฌํ˜„
Yeji-Kim-Erica Mar 14, 2026
23413c3
fix(GameResult): ๊ฒŒ์ž„ ๊ฒฐ๊ณผ ๋ฐ˜ํ™˜ ์‹œ ํ”Œ๋ ˆ์ด์–ด ์ˆœ์„œ๊ฐ€ ์„ž์ด๋Š” ๋ฒ„๊ทธ ์ˆ˜์ •
Yeji-Kim-Erica Mar 14, 2026
e003abd
fix: 21์  ์ด์ƒ ๋„๋‹ฌ ์‹œ ๊ฒŒ์ž„์ด ๋น„์ •์ƒ ์ข…๋ฃŒ๋˜๋Š” ๋ฒ„๊ทธ ์ˆ˜์ •
Yeji-Kim-Erica Mar 14, 2026
5dddc2c
refactor: ์›์‹œ๊ฐ’ ํฌ์žฅ ๋ฐ ์ปจํŠธ๋กค๋Ÿฌ ์˜์กด์„ฑ ์ฃผ์ž… ๋ฐฉ์‹ ๋ณ€๊ฒฝ
Yeji-Kim-Erica Mar 14, 2026
f218f7a
docs: ํด๋ž˜์Šค ๋‹ค์ด์–ด๊ทธ๋žจ ์—…๋ฐ์ดํŠธ
Yeji-Kim-Erica Mar 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 86 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,80 @@

์ฝ˜์†” ๊ธฐ๋ฐ˜์œผ๋กœ ์ฆ๊ธธ ์ˆ˜ ์žˆ๋Š” ๋ธ”๋ž™์žญ ๊ฒŒ์ž„์ž…๋‹ˆ๋‹ค.

## ๐Ÿ’ก ์ฃผ์š” ์šฉ์–ด

- **Blackjack**: ์ฒ˜์Œ ๋ฐ›์€ ์นด๋“œ 2์žฅ์˜ ํ•ฉ์ด 21์ธ ์ƒํƒœ. (2์žฅ์„ ์ดˆ๊ณผํ•ด 21์„ ๋งŒ๋“  ๊ฒฝ์šฐ๋Š” ํฌํ•จํ•˜์ง€ ์•Š์Œ)
- **Bust**: ์นด๋“œ์˜ ์ ์ˆ˜ ํ•ฉ์ด 21์„ ์ดˆ๊ณผํ•œ ์ƒํƒœ. (์ฆ‰์‹œ ํŒจ๋ฐฐ ์ฒ˜๋ฆฌ)
- **Hit / Stand**: ์นด๋“œ๋ฅผ ์ถ”๊ฐ€๋กœ 1์žฅ ๋” ๋ฐ›์„์ง€(Hit), ์—ฌ๊ธฐ์„œ ํ„ด์„ ์ข…๋ฃŒํ• ์ง€(Stand) ๊ฒฐ์ •ํ•˜๋Š” ํ–‰์œ„.

## ๐Ÿš€ ๊ธฐ๋Šฅ ์š”๊ตฌ ์‚ฌํ•ญ

### 1. ๊ฒŒ์ž„ ์ค€๋น„ ๋ฐ ์นด๋“œ ๋ถ„๋ฐฐ

- [x] ์ฐธ์—ฌํ•  ํ”Œ๋ ˆ์ด์–ด๋“ค์˜ ์ด๋ฆ„์„ ์‰ผํ‘œ(,) ๊ธฐ์ค€์œผ๋กœ ์ž…๋ ฅ๋ฐ›๋Š”๋‹ค.
- ์˜ˆ์™ธ: ์ด๋ฆ„์ด ๊ณต๋ฐฑ์ด๊ฑฐ๋‚˜ ํ•œ๊ธ€/์˜๋ฌธ์ด ์•„๋‹Œ ๊ฒฝ์šฐ.
- ์˜ˆ์™ธ: ์ตœ๋Œ€ ์ฐธ์—ฌ ์ธ์›(5๋ช…)์„ ์ดˆ๊ณผํ•˜๋Š” ๊ฒฝ์šฐ.
- [x] ์‚ฌ์šฉ์ž ์ž…๋ ฅ๊ฐ’ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ
- [x] ์ด๋ฆ„ ๋ชฉ๋ก์ด ๊ณต๋ฐฑ์ธ ๊ฒฝ์šฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ
- [x] ์ด๋ฆ„์ด ๊ณต๋ฐฑ์ธ ๊ฒฝ์šฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ
- [x] ๋„๋ฉ”์ธ ๊ทœ์น™ ๊ฒ€์ฆ
- [x] ์ตœ๋Œ€ ์ฐธ์—ฌ ์ธ์›(5๋ช…)์„ ์ดˆ๊ณผํ•˜๋Š” ๊ฒฝ์šฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ
- [x] ์ด๋ฆ„์— ํ•œ๊ธ€ ๋˜๋Š” ์˜๋ฌธ์„ ์ œ์™ธํ•œ ๋ฌธ์ž๊ฐ€ ํฌํ•จ๋˜๋Š” ๊ฒฝ์šฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ
- [x] ๊ฐ ํ”Œ๋ ˆ์ด์–ด์—๊ฒŒ ๋ฐฐํŒ… ๊ธˆ์•ก์„ ์ž…๋ ฅ๋ฐ›๋Š”๋‹ค.
- [x] ์‚ฌ์šฉ์ž ์ž…๋ ฅ๊ฐ’ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ
- [x] ๋ฐฐํŒ… ๊ธˆ์•ก์ด ๊ณต๋ฐฑ์ธ ๊ฒฝ์šฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ
- [x] ์ˆซ์ž๊ฐ€ ์•„๋‹Œ ๋ฌธ์ž๋ฅผ ์ž…๋ ฅํ•œ ๊ฒฝ์šฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ
- [x] ๋ฐฐํŒ… ๊ธˆ์•ก์ด ์ •์ˆ˜ ๋ฒ”์œ„๋ฅผ ์ดˆ๊ณผํ•˜๋Š” ๊ฒฝ์šฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ
- [x] ๋„๋ฉ”์ธ ๊ทœ์น™ ๊ฒ€์ฆ
- [x] ๋ฐฐํŒ… ๊ธˆ์•ก์ด 0 ์ดํ•˜์ธ ๊ฒฝ์šฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ
- [x] ๋”œ๋Ÿฌ์™€ ํ”Œ๋ ˆ์ด์–ด๋“ค์—๊ฒŒ ๋ฌด์ž‘์œ„๋กœ ์„ž์ธ ์นด๋“œ๋ฅผ 2์žฅ์”ฉ ๋‚˜๋ˆ„์–ด ์ค€๋‹ค.
- [x] ๋ถ„๋ฐฐ๋œ ์ดˆ๊ธฐ ์นด๋“œ๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค. (๋”œ๋Ÿฌ๋Š” 1์žฅ๋งŒ ๊ณต๊ฐœ)

### 2. ์นด๋“œ ์ถ”๊ฐ€ ๋ฐœ๊ธ‰ (Hit / Stand)

- [x] ๊ฐ ํ”Œ๋ ˆ์ด์–ด์—๊ฒŒ ์นด๋“œ๋ฅผ ๋” ๋ฐ›์„์ง€(y/n) ์ž…๋ ฅ๋ฐ›๋Š”๋‹ค.
- [x] 'y'๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ์นด๋“œ๋ฅผ 1์žฅ ์ถ”๊ฐ€๋กœ ์ง€๊ธ‰ํ•˜๊ณ  ํ˜„์žฌ ์นด๋“œ๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค.
- [x] ์นด๋“œ์˜ ํ•ฉ์ด 21์„ ์ดˆ๊ณผ(Bust)ํ•˜๋ฉด ๋” ์ด์ƒ ์นด๋“œ๋ฅผ ๋ฐ›์„ ์ˆ˜ ์—†๋‹ค.
- [x] ๋”œ๋Ÿฌ๋Š” ํ”Œ๋ ˆ์ด์–ด์˜ ํ„ด์ด ๋ชจ๋‘ ๋๋‚œ ํ›„, ์นด๋“œ์˜ ํ•ฉ์ด 16 ์ดํ•˜์ด๋ฉด ์นด๋“œ๋ฅผ 1์žฅ ๋” ๋ฐ›๋Š”๋‹ค. (17 ์ด์ƒ์ด๋ฉด ๋ฐ›์ง€ ์•Š์Œ)

### 3. ์ ์ˆ˜ ๊ณ„์‚ฐ ๋ฐ ์ŠนํŒจ ํŒ์ •
- [x] ๋ถ„๋ฐฐ๋œ ์ดˆ๊ธฐ ์นด๋“œ๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค.
- ๋”œ๋Ÿฌ๋Š” 1์žฅ๋งŒ ๊ณต๊ฐœ

### 2. ์นด๋“œ ์ถ”๊ฐ€ ๋ถ„๋ฐฐ (Hit / Stand)

- [x] ์นด๋“œ ์ถ”๊ฐ€ ๋ถ„๋ฐฐ๋Š” ๋‹ค์Œ์˜ ๊ณตํ†ต ์ œ์•ฝ ์กฐ๊ฑด ๋‚ด์—์„œ๋งŒ ๊ฐ€๋Šฅํ•˜๋‹ค.
- [x] ๋„๋ฉ”์ธ ๊ทœ์น™ ๊ฒ€์ฆ
- [x] ์ด๋ฏธ ๋ณด์œ ํ•˜๊ณ  ์žˆ๋Š” ์นด๋“œ์™€ ๋™์ผํ•œ ์นด๋“œ๋ฅผ ์ค‘๋ณตํ•ด์„œ ์ถ”๊ฐ€ํ•˜๋ ค๋Š” ๊ฒฝ์šฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ
- [x] ํ”Œ๋ ˆ์ด์–ด๋Š” ์นด๋“œ ํ•ฉ๊ณ„๊ฐ€ 21 ๋ฏธ๋งŒ์ด๋ผ๋ฉด ๊ณ„์†ํ•ด์„œ ์นด๋“œ๋ฅผ ์ถ”๊ฐ€๋กœ ๋ฐ›์„ ์ˆ˜ ์žˆ๋‹ค.
- [x] ์‚ฌ์šฉ์ž ์ž…๋ ฅ๊ฐ’ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ
- [x] ๋Œ€๋‹ต์ด ๊ณต๋ฐฑ์ธ ๊ฒฝ์šฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ
- [x] `y` ๋˜๋Š” `n` ์ด์™ธ์˜ ๊ฐ’์„ ์ž…๋ ฅํ•œ ๊ฒฝ์šฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ
- [x] ์ž…๋ ฅ๊ฐ’์— ๋”ฐ๋ผ Hit / Stand ์˜์‚ฌ ๊ฒฐ์ •
- `y` ์ž…๋ ฅ ์‹œ: Hit
- `n` ์ž…๋ ฅ ์‹œ: Stand
- [x] ๋”œ๋Ÿฌ๋Š” ์ž์‹ ์˜ ์นด๋“œ ํ•ฉ๊ณ„๊ฐ€ 16 ์ดํ•˜์ด๋ฉด 16์„ ์ดˆ๊ณผํ•  ๋•Œ๊นŒ์ง€ ๋ฌด์กฐ๊ฑด 1์žฅ์„ ๋” ๋ฐ›๋Š”๋‹ค.
- [x] ๋„๋ฉ”์ธ ๊ทœ์น™ ๊ฒ€์ฆ
- [x] ์ด๋ฏธ ๋”œ๋Ÿฌ์˜ ์นด๋“œ ํ•ฉ๊ณ„๊ฐ€ 16์„ ์ดˆ๊ณผํ•ด ๋” ์ด์ƒ ๋ฐ›์„ ์ˆ˜ ์—†๋Š” ๊ฒฝ์šฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ
- [x] ๋”œ๋Ÿฌ์˜ ์นด๋“œ ํ•ฉ๊ณ„๊ฐ€ 16 ์ดํ•˜์ธ ์ƒํƒœ๋กœ ๊ฒŒ์ž„์ด ์ข…๋ฃŒ๋˜๋Š” ๊ฒฝ์šฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ
- [x] ๋”œ๋Ÿฌ๊ฐ€ ์นด๋“œ๋ฅผ ์ถ”๊ฐ€๋กœ ๋ฐ›์•˜๋Š”์ง€ ์—ฌ๋ถ€๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค.

### 3. ์ ์ˆ˜ ๊ณ„์‚ฐ ๋ฐ ์ŠนํŒจ/์ˆ˜์ต ํŒ์ •

- [x] J, Q, K๋Š” 10์œผ๋กœ ๊ณ„์‚ฐํ•œ๋‹ค.
- [x] Ace(A)๋Š” 1 ๋˜๋Š” 11 ์ค‘ ์นด๋“œ ํ•ฉ์‚ฐ ๋ฒ”์œ„(21)๋ฅผ ์ดˆ๊ณผํ•˜์ง€ ์•Š๋Š” ์œ ๋ฆฌํ•œ ๋ฐฉํ–ฅ์œผ๋กœ ๊ณ„์‚ฐํ•œ๋‹ค.
- [x] ๋”œ๋Ÿฌ์™€ ํ”Œ๋ ˆ์ด์–ด์˜ ์ ์ˆ˜๋ฅผ ๋น„๊ตํ•˜์—ฌ ์ตœ์ข… ์ŠนํŒจ๋ฅผ ๊ฒฐ์ •ํ•œ๋‹ค.
- ๋”œ๋Ÿฌ๊ฐ€ Bust์ธ ๊ฒฝ์šฐ, Bust๋˜์ง€ ์•Š์€ ํ”Œ๋ ˆ์ด์–ด๋Š” ๋ชจ๋‘ ์Šน๋ฆฌํ•œ๋‹ค.
- ์ ์ˆ˜๊ฐ€ ๊ฐ™์„ ๊ฒฝ์šฐ ๋ฌด์Šน๋ถ€๋กœ ์ฒ˜๋ฆฌํ•œ๋‹ค.
- [x] Ace๊ฐ€ 1์žฅ ํฌํ•จ๋œ ๊ฒฝ์šฐ
- [x] Ace๋ฅผ 11์ ์œผ๋กœ ๊ณ„์‚ฐํ•ด๋„ Bust๊ฐ€ ๋‚˜์ง€ ์•Š๋Š”๋‹ค๋ฉด, Ace๋ฅผ 11์ ์œผ๋กœ ๊ณ„์‚ฐ
- [x] Ace๋ฅผ 11์ ์œผ๋กœ ๊ณ„์‚ฐ ์‹œ Bust๊ฐ€ ๋‚œ๋‹ค๋ฉด, Ace๋ฅผ 1์ ์œผ๋กœ ๊ณ„์‚ฐ
- [x] Ace๊ฐ€ 2์žฅ ์ด์ƒ ํฌํ•จ๋œ ๊ฒฝ์šฐ
- 2์žฅ ์ด์ƒ์„ 11๋กœ ๊ณ„์‚ฐํ•˜๋ฉด ๋ฌด์กฐ๊ฑด 22์  ์ด์ƒ์œผ๋กœ Bust๊ฐ€ ๋‚˜๋ฏ€๋กœ, 11๋กœ ๊ณ„์‚ฐํ•  ์ˆ˜ ์žˆ๋Š” Ace๋Š” ์ตœ๋Œ€ 1์žฅ
- [x] 1์žฅ์˜ Ace๋ฅผ 11๋กœ ๊ณ„์‚ฐํ–ˆ์„ ๋•Œ Bust๊ฐ€ ๋‚œ๋‹ค๋ฉด, ๋ชจ๋“  Ace๋ฅผ 1์ ์œผ๋กœ ๊ณ„์‚ฐ
- [x] ๋”œ๋Ÿฌ์™€ ํ”Œ๋ ˆ์ด์–ด์˜ ์ตœ์ข… ์ŠนํŒจ ๋ฐ ์กฐ๊ฑด์— ๋”ฐ๋ฅธ ํ”Œ๋ ˆ์ด์–ด์˜ ์ตœ์ข… ์ˆ˜์ต์„ ๊ณ„์‚ฐํ•œ๋‹ค.
- [x] ํ”Œ๋ ˆ์ด์–ด๊ฐ€ ์Šน๋ฆฌํ•œ ๊ฒฝ์šฐ
- [x] ํ”Œ๋ ˆ์ด์–ด๋งŒ Blackjack์ธ ๊ฒฝ์šฐ: ๋ฐฐํŒ… ๊ธˆ์•ก์˜ 1.5๋ฐฐ ์ˆ˜์ต
- [x] ๋”œ๋Ÿฌ๋งŒ Bust์ธ ๊ฒฝ์šฐ: ๋ฐฐํŒ… ๊ธˆ์•ก์˜ 1๋ฐฐ ์ˆ˜์ต
- [x] ํ”Œ๋ ˆ์ด์–ด์™€ ๋”œ๋Ÿฌ ๋ชจ๋‘ Bust๊ฐ€ ์•„๋‹ˆ๊ณ , ํ”Œ๋ ˆ์ด์–ด์˜ ์ ์ˆ˜๊ฐ€ ๋”œ๋Ÿฌ์˜ ์ ์ˆ˜๋ณด๋‹ค ๋†’์€ ๊ฒฝ์šฐ: ๋ฐฐํŒ… ๊ธˆ์•ก์˜ 1๋ฐฐ ์ˆ˜์ต
- [x] ํ”Œ๋ ˆ์ด์–ด๊ฐ€ ํŒจ๋ฐฐํ•œ ๊ฒฝ์šฐ: ๋ฐฐํŒ… ๊ธˆ์•ก๋งŒํผ ์†์‹ค (-1๋ฐฐ)
- [x] ํ”Œ๋ ˆ์ด์–ด๊ฐ€ Bust์ธ ๊ฒฝ์šฐ
- [x] ๋”œ๋Ÿฌ๋งŒ Blackjack์ธ ๊ฒฝ์šฐ
- [x] ํ”Œ๋ ˆ์ด์–ด์™€ ๋”œ๋Ÿฌ ๋ชจ๋‘ Bust๊ฐ€ ์•„๋‹ˆ๊ณ , ํ”Œ๋ ˆ์ด์–ด์˜ ์ ์ˆ˜๊ฐ€ ๋”œ๋Ÿฌ์˜ ์ ์ˆ˜๋ณด๋‹ค ๋‚ฎ์€ ๊ฒฝ์šฐ
- [x] ๋ฌด์Šน๋ถ€์ธ ๊ฒฝ์šฐ: ์ˆ˜์ต 0
- [x] ํ”Œ๋ ˆ์ด์–ด์™€ ๋”œ๋Ÿฌ ๋ชจ๋‘ Blackjack์ธ ๊ฒฝ์šฐ
- [x] ํ”Œ๋ ˆ์ด์–ด์™€ ๋”œ๋Ÿฌ ๋ชจ๋‘ Bust๊ฐ€ ์•„๋‹ˆ๊ณ , ํ”Œ๋ ˆ์ด์–ด์™€ ๋”œ๋Ÿฌ์˜ ์ ์ˆ˜๊ฐ€ ๋™์ผํ•œ ๊ฒฝ์šฐ
- [x] ๋”œ๋Ÿฌ์˜ ์ˆ˜์ต์€ ํ”Œ๋ ˆ์ด์–ด๋“ค์˜ ์ตœ์ข… ์ˆ˜์ต ํ•ฉ์˜ ๋ฐ˜๋Œ€๋กœ ๊ณ„์‚ฐํ•œ๋‹ค.

### 4. ๊ฒŒ์ž„ ๊ฒฐ๊ณผ ์ถœ๋ ฅ

- [x] ๋ชจ๋“  ์ฐธ๊ฐ€์ž์˜ ์ตœ์ข… ์นด๋“œ ๋ชฉ๋ก๊ณผ ์ ์ˆ˜๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค.
- [x] ๋”œ๋Ÿฌ์™€ ํ”Œ๋ ˆ์ด์–ด๋“ค์˜ ์ตœ์ข… ์ŠนํŒจ(์Šน/๋ฌด/ํŒจ)๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค.
- [x] ๋”œ๋Ÿฌ์™€ ํ”Œ๋ ˆ์ด์–ด๋“ค์˜ ์ตœ์ข… ์ˆ˜์ต์„ ์ถœ๋ ฅํ•œ๋‹ค.

## ๐Ÿ—‚๏ธ ํด๋ž˜์Šค ๋‹ค์ด์–ด๊ทธ๋žจ

Expand All @@ -52,8 +97,8 @@ classDiagram
+generateGameResult() GameResult
}
class GameResult {
-Map~Player, Result~ playerResults
-Map~Result, Integer~ dealerResult
-Map~Player, Profit~ playerProfits
-Profit dealerProfit
+calculate(Dealer, Players)$ GameResult
}
class Participant {
Expand All @@ -68,6 +113,12 @@ classDiagram
-String name
}
class Player {
-BetMoney betMoney
+calculateBettingProfit(double) Long
}
class BetMoney {
<<record>>
-int betAmount
}
class Dealer {
}
Expand All @@ -93,11 +144,15 @@ classDiagram
-String number
-int score
}
class Result {
class PlayerResult {
<<enumeration>>
WIN, TIE, LOSS
+determinePlayerResult(...)$ Result
+reverse() Result
BLACKJACK, WIN, TIE, LOSS
-double returnRate
+determinePlayerResult(Dealer, Player)$ PlayerResult
}
class Profit {
<<record>>
-long profit
}
class CardShuffleStrategy {
<<interface>>
Expand All @@ -112,8 +167,7 @@ classDiagram
class BlackJackController {
-InputView inputView
-OutputView outputView
-CardShuffleStrategy strategy
+doGame()
+doGame(CardShuffleStrategy strategy)
}
class InputView {
-Scanner scanner
Expand All @@ -124,8 +178,8 @@ classDiagram
%% 3. DTO ํด๋ž˜์Šค ์„ ์–ธ
class GameResultDto {
<<record>>
-Map~String, Integer~ dealerWinTieLossResult
-Map~String, String~ playerWinTieLossResults
-Map~String, Long~ playerWinTieLossResults
-long dealerWinTieLossResult
}
class ParticipantDto {
<<record>>
Expand All @@ -144,25 +198,25 @@ classDiagram
Game --> Deck
Game --> Dealer
Game --> Players
Game ..> GameResult : generates
Game ..> GameResult: generates
Participant <|-- Player
Participant <|-- Dealer
Participant --> Name
Participant --> Cards
Player --> BetMoney
Players --> Player
Cards --> Card
Deck --> Card
Card --> CardShape
Card --> CardContents
GameResult --> Result
GameResult --> Profit
GameResult ..> PlayerResult: uses
CardShuffleStrategy <|.. RandomCardShuffleStrategy

%% ์ปจํŠธ๋กค๋Ÿฌ ๋ฐ ๋ทฐ ๊ด€๊ณ„
Main --> BlackJackController
BlackJackController --> InputView
BlackJackController --> OutputView
BlackJackController --> CardShuffleStrategy

BlackJackController ..> CardShuffleStrategy: uses
%% DTO ๊ด€๊ณ„
GameResultDto --> ParticipantDto
ParticipantDto --> CardDto
```
5 changes: 3 additions & 2 deletions src/main/java/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ public class Main {
public static void main(String[] args) {
InputView inputView = new InputView();
OutputView outputView = new OutputView();
CardShuffleStrategy strategy = new RandomCardShuffleStrategy();
BlackJackController controller = new BlackJackController(inputView, outputView);

new BlackJackController(inputView, outputView, strategy).doGame();
CardShuffleStrategy strategy = new RandomCardShuffleStrategy();
controller.doGame(strategy);
}
}
20 changes: 0 additions & 20 deletions src/main/java/common/ErrorMessage.java

This file was deleted.

91 changes: 68 additions & 23 deletions src/main/java/controller/BlackJackController.java
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
package controller;

import domain.BetMoney;
import domain.CardShuffleStrategy;
import domain.Dealer;
import domain.Game;
import domain.Name;
import domain.Participant;
import domain.Player;
import domain.Players;
import dto.GameResultDto;
import dto.ParticipantDto;
import java.util.ArrayList;
import java.util.List;
import view.InputView;
import view.OutputView;

public class BlackJackController {
private final InputView inputView;
private final OutputView outputView;
private final CardShuffleStrategy strategy;

public BlackJackController(InputView inputView, OutputView outputView, CardShuffleStrategy strategy) {
public BlackJackController(InputView inputView, OutputView outputView) {
this.inputView = inputView;
this.outputView = outputView;
this.strategy = strategy;
}

public void doGame() {
Game game = setUpGame();
public void doGame(CardShuffleStrategy strategy) {
Game game = setUpGame(strategy);

drawInitialCardsAndShowResult(game);

Expand All @@ -35,12 +36,22 @@ public void doGame() {
showGameResult(game);
}

private Game setUpGame() {
List<String> playerNames = repeatAskPlayerNamesUntilSuccess();
return Game.registerParticipantsAndPrepareTotalDeck(playerNames, strategy);
private Game setUpGame(CardShuffleStrategy strategy) {
Players players = generatePlayers();
return Game.registerParticipantsAndPrepareTotalDeck(players, strategy);
}

private List<String> repeatAskPlayerNamesUntilSuccess() {
private Players generatePlayers() {
List<Name> playerNames = repeatAskPlayerNamesUntilSuccess();
List<Player> players = new ArrayList<>();
for (Name playerName : playerNames) {
Player player = generatePlayer(playerName);
players.add(player);
}
return Players.of(players);
}

private List<Name> repeatAskPlayerNamesUntilSuccess() {
try {
return askPlayerNames();
} catch (IllegalArgumentException e) {
Expand All @@ -49,9 +60,33 @@ private List<String> repeatAskPlayerNamesUntilSuccess() {
}
}

private List<String> askPlayerNames() {
private List<Name> askPlayerNames() {
outputView.printNamePrompt();
return inputView.readNames();
List<String> playerNames = inputView.readNames();
Players.validatePlayersCount(playerNames.size());
return playerNames.stream()
.map(Name::new)
.toList();
}

private Player generatePlayer(Name playerName) {
BetMoney betMoney = repeatAskBetMoneyUntilSuccess(playerName);
return new Player(playerName, betMoney);
}

private BetMoney repeatAskBetMoneyUntilSuccess(Name playerName) {
try {
return askBetAmount(playerName);
} catch (IllegalArgumentException e) {
outputView.printErrorMessage(e);
return repeatAskBetMoneyUntilSuccess(playerName);
}
}

private BetMoney askBetAmount(Name playerName) {
outputView.printBetMoneyPrompt(playerName.name());
int betAmount = inputView.readBetAmount();
return new BetMoney(betAmount);
}

private void drawInitialCardsAndShowResult(Game game) {
Expand All @@ -77,8 +112,19 @@ private void drawCardPerPlayerAndShowResult(Game game) {
}

private void drawCardUntilBustOrStand(Game game, Player player) {
while (player.isDrawable() && wantToHit(player)) {
drawCardAndPrintResult(game, player);
boolean isPlayerDrawingCard = player.isDrawable();
while (isPlayerDrawingCard) {
boolean wantToHit = wantToHit(player);
drawCardIfDrawableAndWantToHit(game, player, wantToHit);
isPlayerDrawingCard = player.isDrawable() && wantToHit;
ParticipantDto updatedPlayerDto = ParticipantDto.from(player);
showPlayerCards(updatedPlayerDto);
}
}

private void drawCardIfDrawableAndWantToHit(Game game, Player player, boolean wantToHit) {
if (wantToHit) {
game.drawCardUnderCondition(player);
}
}

Expand All @@ -98,14 +144,7 @@ private boolean repeatAskDrawCardUntilSuccess(ParticipantDto playerDto) {

private boolean askDrawCard(ParticipantDto participantDto) {
outputView.printHitOrStandPrompt(participantDto);
String input = inputView.readHitOrStand();
return input.equals("y");
}

private void drawCardAndPrintResult(Game game, Player player) {
game.drawCardUnderCondition(player);
ParticipantDto updatedPlayerDto = ParticipantDto.from(player);
showPlayerCards(updatedPlayerDto);
return inputView.readHitOrStand();
}

private void showPlayerCards(ParticipantDto participantDto) {
Expand All @@ -114,13 +153,19 @@ private void showPlayerCards(ParticipantDto participantDto) {

private void checkAndAdjustDealerCards(Game game) {
Dealer dealer = game.getDealer();
boolean hasDealerDrawnMoreCard = game.drawCardUnderCondition(dealer);
while (dealer.isDrawable()) {
boolean hasDealerDrawnMoreCard = game.drawCardUnderCondition(dealer);
printDescriptionIfDealerDrewCard(hasDealerDrawnMoreCard);
}
}

private void printDescriptionIfDealerDrewCard(boolean hasDealerDrawnMoreCard) {
if (hasDealerDrawnMoreCard) {
outputView.printAdditionalCardForDealerDescription();
}
}

public void showGameResult(Game game) {
private void showGameResult(Game game) {
List<Participant> participants = game.getParticipants();
List<ParticipantDto> participantDtos = ParticipantDto.listOf(participants);
outputView.printCardInfosWithSum(participantDtos);
Expand Down
Loading