diff --git a/README.md b/README.md
index 003db037a..cc3750060 100644
--- a/README.md
+++ b/README.md
@@ -1,76 +1,75 @@
-# java-blackjack
-
-## ๐ ๊ธฐ๋ฅ ์๊ตฌ ์ฌํญ
-
-## โ
1๋จ๊ณ - ๋ธ๋์ญ ๊ตฌํ
-
-๋ธ๋์ญ ๊ฒ์์ ๋ณํํ ํ๋ก๊ทธ๋จ์ ๊ตฌํํ๋ค. ๋ธ๋์ญ ๊ฒ์์ ๋๋ฌ์ ํ๋ ์ด์ด ์ค ์นด๋์ ํฉ์ด 21 ๋๋ 21์ ๊ฐ์ฅ ๊ฐ๊น์ด ์ซ์๋ฅผ ๊ฐ์ง๋ ์ชฝ์ด ์ด๊ธฐ๋ ๊ฒ์์ด๋ค.
-
-์นด๋์ ์ซ์ ๊ณ์ฐ์ ์นด๋ ์ซ์๋ฅผ ๊ธฐ๋ณธ์ผ๋ก ํ๋ฉฐ, ์์ธ๋ก Ace๋ 1 ๋๋ 11๋ก ๊ณ์ฐํ ์ ์์ผ๋ฉฐ, King, Queen, Jack์ ๊ฐ๊ฐ 10์ผ๋ก ๊ณ์ฐํ๋ค.
-๊ฒ์์ ์์ํ๋ฉด ํ๋ ์ด์ด๋ ๋ ์ฅ์ ์นด๋๋ฅผ ์ง๊ธ ๋ฐ์ผ๋ฉฐ, ๋ ์ฅ์ ์นด๋ ์ซ์๋ฅผ ํฉ์ณ 21์ ์ด๊ณผํ์ง ์์ผ๋ฉด์ 21์ ๊ฐ๊น๊ฒ ๋ง๋ค๋ฉด ์ด๊ธด๋ค. 21์ ๋์ง ์์ ๊ฒฝ์ฐ ์ํ๋ค๋ฉด ์ผ๋ง๋ ์ง ์นด๋๋ฅผ ๊ณ์ ๋ฝ์ ์ ์๋ค.
-๋๋ฌ๋ ์ฒ์์ ๋ฐ์ 2์ฅ์ ํฉ๊ณ๊ฐ 16์ดํ์ด๋ฉด ๋ฐ๋์ 1์ฅ์ ์นด๋๋ฅผ ์ถ๊ฐ๋ก ๋ฐ์์ผ ํ๊ณ , 17์ ์ด์์ด๋ฉด ์ถ๊ฐ๋ก ๋ฐ์ ์ ์๋ค.
-๊ฒ์์ ์๋ฃํ ํ ๊ฐ ํ๋ ์ด์ด๋ณ๋ก ์นํจ๋ฅผ ์ถ๋ ฅํ๋ค.
-
-## ๐ป ์คํ ๊ฒฐ๊ณผ
-```
-๊ฒ์์ ์ฐธ์ฌํ ์ฌ๋์ ์ด๋ฆ์ ์
๋ ฅํ์ธ์.(์ผํ ๊ธฐ์ค์ผ๋ก ๋ถ๋ฆฌ)
-pobi,jason
-
-๋๋ฌ์ pobi, jason์๊ฒ 2์ฅ์ ๋๋์์ต๋๋ค.
-๋๋ฌ: 3๋ค์ด์๋ชฌ๋
-pobi์นด๋: 2ํํธ, 8์คํ์ด๋
-jason์นด๋: 7ํด๋ก๋ฒ, K์คํ์ด๋
-
-pobi๋ ํ์ฅ์ ์นด๋๋ฅผ ๋ ๋ฐ๊ฒ ์ต๋๊น?(์๋ y, ์๋์ค๋ n)
-y
-pobi์นด๋: 2ํํธ, 8์คํ์ด๋, Aํด๋ก๋ฒ
-pobi๋ ํ์ฅ์ ์นด๋๋ฅผ ๋ ๋ฐ๊ฒ ์ต๋๊น?(์๋ y, ์๋์ค๋ n)
-n
-pobi์นด๋: 2ํํธ, 8์คํ์ด๋, Aํด๋ก๋ฒ
-jason์ ํ์ฅ์ ์นด๋๋ฅผ ๋ ๋ฐ๊ฒ ์ต๋๊น?(์๋ y, ์๋์ค๋ n)
-n
-jason์นด๋: 7ํด๋ก๋ฒ, K์คํ์ด๋
-
-๋๋ฌ๋ 16์ดํ๋ผ ํ์ฅ์ ์นด๋๋ฅผ ๋ ๋ฐ์์ต๋๋ค.
-
-๋๋ฌ ์นด๋: 3๋ค์ด์๋ชฌ๋, 9ํด๋ก๋ฒ, 8๋ค์ด์๋ชฌ๋ - ๊ฒฐ๊ณผ: 20
-pobi์นด๋: 2ํํธ, 8์คํ์ด๋, Aํด๋ก๋ฒ - ๊ฒฐ๊ณผ: 21
-jason์นด๋: 7ํด๋ก๋ฒ, K์คํ์ด๋ - ๊ฒฐ๊ณผ: 17
-
-## ์ต์ข
์นํจ
-๋๋ฌ: 1์น 1ํจ
-pobi: ์น
-jason: ํจ
-```
-
-## โ
2๋จ๊ณ - ๋ธ๋์ญ ๊ตฌํ
-
-- 1๋จ๊ณ ๋ฏธ์
์ด ์ด๋์ ๋ ๊ตฌํ๋ ํ์ ๊ณต๊ฐํ ์์
-
-## ๐ฅ๏ธ ํ๋ก๊ทธ๋๋ฐ ์๊ตฌ ์ฌํญ
-- indent(์ธ๋ดํธ, ๋ค์ฌ์ฐ๊ธฐ) depth๋ฅผ 3๋ฅผ ๋์ง ์๋๋ก ๊ตฌํํ๋ค. 2๊น์ง๋ง ํ์ฉํ๋ค. ( ๊ฐ์ธ์ ์ญ๋์ ๋ง์ถฐ 1๊น์ง ํ์ฉํ์ฌ ์งํํด๋ณผ ๊ฒ์ ์ถ์ฒ )
- - ์๋ฅผ ๋ค์ด while๋ฌธ ์์ if๋ฌธ์ด ์์ผ๋ฉด ๋ค์ฌ์ฐ๊ธฐ๋ 2์ด๋ค.
- - ํํธ: indent(์ธ๋ดํธ, ๋ค์ฌ์ฐ๊ธฐ) depth๋ฅผ ์ค์ด๋ ์ข์ ๋ฐฉ๋ฒ์ ํจ์(๋๋ ๋ฉ์๋)๋ฅผ ๋ถ๋ฆฌํ๋ฉด ๋๋ค.
-- 3ํญ ์ฐ์ฐ์๋ฅผ ์ฐ์ง ์๋๋ค.
-- else ์์ฝ์ด๋ฅผ ์ฐ์ง ์๋๋ค.
- - else ์์ฝ์ด๋ฅผ ์ฐ์ง ๋ง๋ผ๊ณ ํ๋ switch/case๋ก ๊ตฌํํ๋ ๊ฒฝ์ฐ๊ฐ ์๋๋ฐ switch/case๋ ํ์ฉํ์ง ์๋๋ค.
- - ํํธ: if๋ฌธ์์ ๊ฐ์ ๋ฐํํ๋ ๋ฐฉ์์ผ๋ก ๊ตฌํํ๋ฉด else ์์ฝ์ด๋ฅผ ์ฌ์ฉํ์ง ์์๋ ๋๋ค.
-- ํต์ฌ ๋ก์ง์ ๊ตฌํํ๋ ์ฝ๋์ UI๋ฅผ ๋ด๋นํ๋ ๋ก์ง์ ๊ตฌ๋ถํ๋ค.
- - UI ๋ก์ง์ InputView, ResultView์ ๊ฐ์ ํด๋์ค๋ฅผ ์ถ๊ฐํด ๋ถ๋ฆฌํ๋ค.
-- ํจ์(๋๋ ๋ฉ์๋)์ ๊ธธ์ด๊ฐ 10๋ผ์ธ์ ๋์ด๊ฐ์ง ์๋๋ก ๊ตฌํํ๋ค.
-- ํจ์(๋๋ ๋ฉ์๋)๊ฐ ํ ๊ฐ์ง ์ผ๋ง ํ๋๋ก ์ต๋ํ ์๊ฒ ๋ง๋ค์ด๋ผ.
-
-## ๐ฅ ์ถ๊ฐ๋ ์๊ตฌ ์ฌํญ
-- Java 11 ์ผ๋ก ๋ณ๊ฒฝํ๋ค.
-- ๋ชจ๋ ์์ ๊ฐ๊ณผ ๋ฌธ์์ด์ ํฌ์ฅํ๋ค [์ฐธ๊ณ ๊ธ](https://tecoble.techcourse.co.kr/post/2020-05-29-wrap-primitive-type/)
-- ๊ตฌํํ ๊ธฐ๋ฅ์ Test๋ฅผ ์ถ๊ฐํ๋ค. ๋จ, UI(System.out, System.in) ๋ก์ง์ ์ ์ธ
-- ๋ฐฐ์ด ๋์ ์ปฌ๋ ์
์ ์ฌ์ฉํ๋ค.
-- 3๊ฐ ์ด์์ ์ธ์คํด์ค ๋ณ์๋ฅผ ๊ฐ์ง ํด๋์ค๋ฅผ ์ฐ์ง ์๋๋ค.
-- ๋๋ฌ์ ํ๋ ์ด์ด์์ ๋ฐ์ํ๋ ์ค๋ณต ์ฝ๋๋ฅผ ์ ๊ฑฐํด์ผ ํ๋ค.
-- ์ผ๊ธ ์ปฌ๋ ์
์ ์ด๋ค. [์ฐธ๊ณ ๊ธ](https://jojoldu.tistory.com/412)
-
-## ๐ ๊ณผ์ ์งํ ์๊ตฌ ์ฌํญ
-- ๋ฏธ์
์ ํด๋น ์ ์ฅ์๋ฅผ Fork/Cloneํจ์ผ๋ก๋ถํฐ ์์๋๋ค.
-- ๊ธฐ๋ฅ์ ๊ตฌํํ๊ธฐ ์ ์ java-baseball/docs/README.md ํ์ผ์ ๊ตฌํํ ๊ธฐ๋ฅ ๋ชฉ๋ก์ ์ ๋ฆฌํด ์ถ๊ฐํ๋ค.
-- Git์ ์ปค๋ฐ ๋จ์๋ ์ ๋จ๊ณ์์ README.md ํ์ผ์ ์ ๋ฆฌํ ๊ธฐ๋ฅ ๋ชฉ๋ก ๋จ์๋ก ์ถ๊ฐํ๋ค.
-- ์ปค๋ฐ ๋ฉ์์ง [์ปจ๋ฒค์
๊ฐ์ด๋](https://gist.github.com/stephenparish/9941e89d80e2bc58a153)๋ฅผ ์ฐธ๊ณ ํด ์ปค๋ฐ ๋ฉ์์ง๋ฅผ ์์ฑํ๋ค.
+# ๊ธฐ๋ฅ ๋ชฉ๋ก
+
+
+
+## view
+
+- [x] ์
๋ ฅ
+ - [x] ํ๋ ์ด์ด ๋ชฉ๋ก ์
๋ ฅ
+ - [x] ํ๋ ์ด์ด๊ฐ ์นด๋๋ฅผ ๋ฐ์์ง ์ฌ๋ถ(y/n) ์
๋ ฅ
+ - [x] y ๋๋ n์ธ์ง ๊ฒ์ฆ
+
+- [x] ์ถ๋ ฅ
+ - [x] ํ๋ ์ด์ด ์ด๋ฆ ์
๋ ฅํ๊ธฐ ๋ฌธ๊ตฌ
+ - [x] ๊ฒ์ ์์ ์ ์นด๋ 2์ฅ ๋ฐฐ๋ถ์ ๋ํ ๋ฌธ๊ตฌ
+ - [x] ์ฐธ์ฌ์ ์นด๋ ๋ฆฌ์คํธ ๋ด์ ์นด๋ ์ถ๋ ฅ (jason์นด๋: 7ํด๋ก๋ฒ, K์คํ์ด๋)
+ - [x] ํ๋ ์ด์ด๊ฐ ์นด๋๋ฅผ ๋ฐ์์ง ์ฌ๋ถ(y/n) ๋ฌป๋ ๋ฌธ๊ตฌ
+ - [x] ๋๋ฌ ์นด๋ ์ถ๊ฐ์ ์ผ๋ก ๋ฐ์์ ๋ ๋ฌธ๊ตฌ
+ - [x] ์นด๋ ์ ์ ๊ณ์ฐ ๊ฒฐ๊ณผ ์ถ๋ ฅ
+ - [x] ์ต์ข
์นํจ ๊ฒฐ๊ณผ ์ถ๋ ฅ
+
+
+
+## domain
+
+### participant
+
+- [x] ์ฐธ๊ฐ์(ํด๋์ค)
+ - [x] ์ ์ ๋ฐํ ๊ธฐ๋ฅ
+- [x] ํ๋ ์ด์ด(์ฐธ๊ฐ์ ์์)
+
+- [x] ๋๋ฌ(์ฐธ๊ฐ์ ์์)
+
+- [x] ์ด๋ฆ: ์ฐธ๊ฐ์์ ํ๋
+
+- [x] ํ๋ ์ด์ด ๋ฆฌ์คํธ
+
+- [x] ์นด๋ ๋ฆฌ์คํธ: ๋๋ฌ์ ํ๋ ์ด์ด๊ฐ ๋ฐฐ๋ถ ๋ฐ์ ์นด๋๋ค ๋ด๋ ๋ฆฌ์คํธ
+ - [x] ์ ์ ๊ณ์ฐ ๊ธฐ๋ฅ
+
+### carddeck
+
+- [x] ์นด๋ ์ฌ๋ณผ(ํํธ~์คํ์ด๋)
+
+- [x] ์นด๋ ๋ญํฌ(๋ญํฌ(์์ด์ค~์ญ,ํธ,ํน)์ ์ซ์ ๊ฐ)
+
+- [x] ์นด๋: ์ฌ๋ณผ(ํํธ, ์คํ์ด๋, ๋ค์ด์๋ชฌ๋, ํด๋ก๋ฒ)๊ณผ ๋ญํฌ(์์ด์ค~ํน) ์กฐํฉ์ผ๋ก ์ด๋ฃจ์ด์ง ์นด๋
+
+- [x] ์นด๋๋ฑ: 52๊ฐ์ง ์นด๋ ๋ด๊ณ ์๋ ํ๋์ ์นด๋๋ฑ
+ - [x] ์นด๋๋ฑ์์ ์นด๋ ์ถ์ถํ์ฌ ๋ฐํ
+
+### constants
+
+- [x] ์์
+
+- [x] ์นํจ ๊ฒฐ๊ณผ ์์
+
+
+### ๋น์ฆ๋์ค ๋ก์ง
+
+- [x] ๋ธ๋์ญ: ์นด๋๋ฑ ์์ฑ, ์ฐธ๊ฐ์์ ์นด๋ ๋ฐฐ๋ถ
+
+- [x] ์นด๋ ์ ์ ๊ณ์ฐ
+
+- [x] ๋๋ฌ ์น๋ฆฌ ์ฑํฌ
+
+
+
+## controller
+
+- [x] ๊ฒ์ ๋งค๋์
+ - [x] ๊ฒ์ ์์
+ - [x] ์ฐธ๊ฐ์ ์์ฑ
+ - [x] ๋ธ๋์ญ ๊ฒ์ ์์
+ - [x] ์ ์ ๊ณ์ฐ ๊ฒฐ๊ณผ ์ถ๋ ฅ
+ - [x] ์ต์ข
์นํจ ๊ฒฐ๊ณผ ์ถ๋ ฅ
\ No newline at end of file
diff --git a/md b/md
new file mode 100644
index 000000000..e69de29bb
diff --git a/src/main/java/Application.java b/src/main/java/Application.java
new file mode 100644
index 000000000..b0b0391f1
--- /dev/null
+++ b/src/main/java/Application.java
@@ -0,0 +1,9 @@
+import controller.GameManager;
+
+public class Application {
+
+ public static void main(String[] args) {
+ GameManager gameManager = new GameManager();
+ gameManager.gameStart();
+ }
+}
diff --git a/src/main/java/carddeck/Card.java b/src/main/java/carddeck/Card.java
new file mode 100644
index 000000000..f468f9e32
--- /dev/null
+++ b/src/main/java/carddeck/Card.java
@@ -0,0 +1,25 @@
+package carddeck;
+
+public class Card {
+
+ private final CardSuit cardSuit;
+ private final CardRank cardRank;
+
+ public Card(CardSuit cardSuit, CardRank cardRank) {
+ this.cardSuit = cardSuit;
+ this.cardRank = cardRank;
+ }
+
+ @Override
+ public String toString() {
+ return this.cardRank.getRank() + this.cardSuit.getValue();
+ }
+
+ public CardSuit getCardSuit() {
+ return this.cardSuit;
+ }
+
+ public CardRank getCardRank() {
+ return this.cardRank;
+ }
+}
diff --git a/src/main/java/carddeck/CardDeck.java b/src/main/java/carddeck/CardDeck.java
new file mode 100644
index 000000000..06ab436bd
--- /dev/null
+++ b/src/main/java/carddeck/CardDeck.java
@@ -0,0 +1,42 @@
+package carddeck;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class CardDeck {
+
+ private List cardDeck;
+
+ public CardDeck() {
+ initializeCardDeck();
+ shuffleCardDeck();
+ }
+
+ private void initializeCardDeck() {
+ CardSuit[] suits = CardSuit.values();
+ CardRank[] ranks = CardRank.values();
+
+ this.cardDeck = new ArrayList();
+
+ for (CardSuit suit : suits) {
+ for (CardRank rank : ranks) {
+ Card card = new Card(suit, rank);
+ this.cardDeck.add(card);
+ }
+ }
+ }
+
+ private void shuffleCardDeck() {
+ Collections.shuffle(this.cardDeck);
+ }
+
+ public Card drawCard() {
+ if (this.cardDeck.isEmpty()) {
+ throw new IllegalArgumentException("์นด๋๋ฑ์ด ๋น์ด ์์ต๋๋ค.");
+ }
+
+ return this.cardDeck.remove(0);
+ }
+
+}
diff --git a/src/main/java/carddeck/CardRank.java b/src/main/java/carddeck/CardRank.java
new file mode 100644
index 000000000..a0e9fac72
--- /dev/null
+++ b/src/main/java/carddeck/CardRank.java
@@ -0,0 +1,25 @@
+package carddeck;
+
+public enum CardRank {
+
+ ACE("A", 1), TWO("2", 2), THREE("3", 3), FOUR("4", 4), FIVE("5", 5),
+ SIX("6", 6), SEVEN("7", 7), EIGHT("8", 8), NINE("9", 9), TEN("10", 10),
+ JACK("J", 10), QUEEN("Q", 10), KING("K", 10);
+
+ private final String rank;
+ private final int value;
+
+ CardRank(String rank, int value) {
+ this.rank = rank;
+ this.value = value;
+ }
+
+ public String getRank() {
+ return rank;
+ }
+
+ public int getValue() {
+ return value;
+ }
+
+}
diff --git a/src/main/java/carddeck/CardSuit.java b/src/main/java/carddeck/CardSuit.java
new file mode 100644
index 000000000..a5b43dbec
--- /dev/null
+++ b/src/main/java/carddeck/CardSuit.java
@@ -0,0 +1,16 @@
+package carddeck;
+
+public enum CardSuit {
+ HEARTS("ํํธ"), DIAMONDS("๋ค์ด์๋ชฌ๋"), CLUBS("ํด๋ก๋ฒ"), SPADES("์คํ์ด๋");
+
+ private final String value;
+
+ CardSuit(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+}
diff --git a/src/main/java/constants/Constant.java b/src/main/java/constants/Constant.java
new file mode 100644
index 000000000..09d18ba76
--- /dev/null
+++ b/src/main/java/constants/Constant.java
@@ -0,0 +1,8 @@
+package constants;
+
+public class Constant {
+
+ public static final String YES = "y";
+ public static final String NO = "n";
+
+}
diff --git a/src/main/java/constants/Result.java b/src/main/java/constants/Result.java
new file mode 100644
index 000000000..1b5c21503
--- /dev/null
+++ b/src/main/java/constants/Result.java
@@ -0,0 +1,18 @@
+package constants;
+
+public enum Result {
+ PLAYER_WIN("์น"),
+ PLAYER_LOSE("ํจ"),
+ BUST("ํจ"),
+ PUSH("๋ฌด์น๋ถ");
+
+ private final String value;
+
+ Result(String value) {
+ this.value = value;
+ }
+
+ public String getValue() {
+ return this.value;
+ }
+}
diff --git a/src/main/java/controller/GameManager.java b/src/main/java/controller/GameManager.java
new file mode 100644
index 000000000..27607ff1d
--- /dev/null
+++ b/src/main/java/controller/GameManager.java
@@ -0,0 +1,132 @@
+package controller;
+
+import constants.Constant;
+import constants.Result;
+import domain.BlackJack;
+import domain.DealerWinChecker;
+import participant.*;
+import view.InputView;
+import view.OutputView;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+public class GameManager {
+
+ private InputView inputView;
+ private OutputView outputView;
+ private BlackJack blackJack;
+
+ public GameManager() {
+ this.inputView = new InputView();
+ this.outputView = new OutputView();
+ }
+
+ public void gameStart() {
+ List participants = getParticipants();
+ Dealer dealer = getDealer(participants);
+
+ this.blackJack = new BlackJack(participants);
+ for (Participant participant : participants) {
+ outputView.printParticipantCardList(participant);
+ }
+
+ outputView.printEmptyLine();
+
+ for (Participant participant : participants) {
+ if (!participant.isDealer()) {
+ askForAdditionCard(participant);
+ }
+ }
+
+ outputView.printEmptyLine();
+
+ if (blackJack.isDealerAboveThreshold(dealer)) {
+ blackJack.distributeCard(dealer);
+ outputView.printDealerGetOneMoreCard();
+ }
+
+ for (Participant participant : participants) {
+ int score = participant.getScore();
+ outputView.printScore(participant, score);
+ }
+
+ outputView.printEmptyLine();
+
+ DealerWinChecker dealerWinChecker = new DealerWinChecker(dealer);
+ HashMap playerResult = new HashMap<>();
+ for (Participant participant : participants) {
+ if (!participant.isDealer()) {
+ Result result = dealerWinChecker.checkDealerWin((Player) participant);
+ playerResult.put(participant.getName(), result.getValue());
+ }
+ }
+
+ List dealerResult = new ArrayList();
+ dealerResult.add(dealerWinChecker.getWinNum());
+ dealerResult.add(dealerWinChecker.getLoseNum());
+ dealerResult.add(dealerWinChecker.getPushNum());
+
+ outputView.printFinalResult(dealerResult, playerResult);
+
+ }
+
+ private List getParticipants() {
+ List playerList = getPlayerList();
+
+ List participants = new ArrayList();
+ Dealer dealer = new Dealer();
+ participants.add(dealer);
+ for (Player player : playerList) {
+ participants.add((Participant) player);
+ }
+
+ List playerNameList = new ArrayList();
+ for (Player player : playerList) {
+ playerNameList.add(player.getName());
+ }
+ outputView.printInitialCardDistributionMessage(playerNameList);
+ return participants;
+ }
+
+ private Dealer getDealer(List participants) {
+ for (Participant participant : participants) {
+ if (participant.isDealer()) {
+ return (Dealer) participant;
+ }
+ }
+ return null;
+ }
+
+ private List getPlayerList() {
+ try {
+ outputView.printInputPlayerNameMessage();
+ List nameList = inputView.inputPlayerName();
+ PlayerList playerList = new PlayerList(nameList);
+ return playerList.getPlayerList();
+ } catch (IllegalArgumentException e) {
+ System.out.println(e.getMessage());
+ return getPlayerList();
+ }
+ }
+
+ private void askForAdditionCard(Participant participant) {
+ String name = participant.getName();
+ try {
+ outputView.printAskForAdditionalCard(name);
+ String answer = inputView.askForAdditionalCard();
+ if (answer.equals(Constant.YES)) {
+ this.blackJack.distributeCard(participant);
+ outputView.printParticipantCardList(participant);
+ askForAdditionCard(participant);
+ }
+ if (answer.equals(Constant.NO)) {
+ outputView.printParticipantCardList(participant);
+ }
+ } catch (IllegalArgumentException e) {
+ System.out.println("[ERROR] " + e.getMessage());
+ askForAdditionCard(participant);
+ }
+ }
+}
diff --git a/src/main/java/domain/BlackJack.java b/src/main/java/domain/BlackJack.java
new file mode 100644
index 000000000..d9a7ad2e4
--- /dev/null
+++ b/src/main/java/domain/BlackJack.java
@@ -0,0 +1,49 @@
+package domain;
+
+import carddeck.Card;
+import carddeck.CardDeck;
+import participant.Dealer;
+import participant.Participant;
+
+import java.util.List;
+
+public class BlackJack {
+
+ private final int INITIAL_CARD_DISTRIBUTION_COUNT = 2;
+ public final int DEALER_THRESHOLD = 16;
+
+ private List participants;
+ private CardDeck cardDeck;
+
+ public BlackJack(List participants) {
+ this.participants = participants;
+ this.cardDeck = new CardDeck();
+ initialCardDistribution();
+ }
+
+ private void initialCardDistribution() {
+ for (Participant participant : participants) {
+ for (int i = 0; i < INITIAL_CARD_DISTRIBUTION_COUNT; i++) {
+ distributeCard(participant);
+ }
+ }
+ }
+
+ public void distributeCard(Participant participant) {
+ try {
+ Card card = this.cardDeck.drawCard();
+ participant.receiveCard(card);
+ } catch (IllegalArgumentException e) {
+ System.out.println("[ERROR] " + e.getMessage());
+ }
+ }
+
+ public boolean isDealerAboveThreshold(Dealer dealer) {
+ int score = dealer.getScore();
+ if (score <= DEALER_THRESHOLD) {
+ return true;
+ }
+ return false;
+ }
+
+}
diff --git a/src/main/java/domain/DealerWinChecker.java b/src/main/java/domain/DealerWinChecker.java
new file mode 100644
index 000000000..5a40f122d
--- /dev/null
+++ b/src/main/java/domain/DealerWinChecker.java
@@ -0,0 +1,70 @@
+package domain;
+
+import constants.Constant;
+import constants.Result;
+import participant.Dealer;
+import participant.Player;
+
+public class DealerWinChecker {
+
+ private final int TARGET_SCORE = 21;
+ private int dealerScore;
+ private int winNum;
+ private int loseNum;
+ private int pushNum;
+
+ public DealerWinChecker(Dealer dealer) {
+ this.dealerScore = dealer.getScore();
+ this.winNum = 0;
+ this.loseNum = 0;
+ }
+
+ public Result checkDealerWin(Player player) {
+ int playerScore = player.getScore();
+ boolean dealerBust = checkBust(this.dealerScore);
+ boolean playerBust = checkBust(playerScore);
+ if (dealerBust && playerBust) {
+ this.loseNum += 1;
+ return Result.BUST;
+ }
+ if (!dealerBust) {
+ if (playerBust || (this.dealerScore > playerScore)) {
+ this.winNum += 1;
+ return Result.PLAYER_LOSE;
+ }
+ }
+ if(!playerBust) {
+ if (dealerBust || (playerScore > this.dealerScore)) {
+ this.loseNum += 1;
+ return Result.PLAYER_WIN;
+ }
+ }
+ if (!(dealerBust && playerBust)) {
+ if (playerScore == this.dealerScore) {
+ pushNum += 1;
+ return Result.PUSH;
+ }
+ }
+ return null;
+ }
+
+ private boolean checkBust(int score) {
+ if (score > TARGET_SCORE) {
+ return true;
+ }
+ return false;
+ }
+
+ public int getWinNum() {
+ return this.winNum;
+ }
+
+ public int getLoseNum() {
+ return this.loseNum;
+ }
+
+ public int getPushNum() {
+ return this.pushNum;
+ }
+
+}
diff --git a/src/main/java/participant/CardList.java b/src/main/java/participant/CardList.java
new file mode 100644
index 000000000..820cd22e2
--- /dev/null
+++ b/src/main/java/participant/CardList.java
@@ -0,0 +1,48 @@
+package participant;
+
+import carddeck.Card;
+import carddeck.CardRank;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class CardList {
+
+ private List cardList;
+
+ public CardList() {
+ this.cardList = new ArrayList();
+ }
+
+ public void addCard(Card card) {
+ this.cardList.add(card);
+ }
+
+ public int calculateScore() {
+ int sum = 0;
+ int numOfAce = 0;
+ for (Card card : cardList) {
+ CardRank cardRank = card.getCardRank();
+ if (cardRank.getRank().equals(CardRank.ACE.getRank())) {
+ numOfAce += 1;
+ }
+ sum += cardRank.getValue();
+ }
+ sum = calculateAceValue(numOfAce, sum);
+ return sum;
+ }
+
+ private int calculateAceValue(int numOfAce, int sum) {
+ for (int i = 0; i < numOfAce; i++) {
+ if (sum + 10 <= 21) {
+ sum += 10;
+ }
+ }
+ return sum;
+ }
+
+ public List getCardList() {
+ return this.cardList;
+ }
+
+}
diff --git a/src/main/java/participant/Dealer.java b/src/main/java/participant/Dealer.java
new file mode 100644
index 000000000..2de5272ce
--- /dev/null
+++ b/src/main/java/participant/Dealer.java
@@ -0,0 +1,14 @@
+package participant;
+
+public class Dealer extends Participant{
+
+ public Dealer() {
+ super(new Name("๋๋ฌ"));
+ }
+
+ @Override
+ public boolean isDealer() {
+ return true;
+ }
+
+}
diff --git a/src/main/java/participant/Name.java b/src/main/java/participant/Name.java
new file mode 100644
index 000000000..2f63c6318
--- /dev/null
+++ b/src/main/java/participant/Name.java
@@ -0,0 +1,23 @@
+package participant;
+
+public class Name {
+
+ private String name;
+
+ public Name(String name) {
+ String trimmedName = name.trim();
+ IsNameEmpty(name);
+ this.name = name;
+ }
+
+ private void IsNameEmpty(String name) {
+ if (name.isEmpty() || name.isBlank()) {
+ throw new IllegalArgumentException("์ด๋ฆ ๋น์นธ ๋ถ๊ฐ");
+ }
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+}
diff --git a/src/main/java/participant/Participant.java b/src/main/java/participant/Participant.java
new file mode 100644
index 000000000..63b148574
--- /dev/null
+++ b/src/main/java/participant/Participant.java
@@ -0,0 +1,37 @@
+package participant;
+
+import carddeck.Card;
+
+import java.util.List;
+
+public class Participant {
+
+ private Name name;
+ private CardList cardList;
+
+ public Participant(Name name) {
+ this.name = name;
+ this.cardList = new CardList();
+ }
+
+ public boolean isDealer() {
+ return false;
+ }
+
+ public void receiveCard(Card card) {
+ this.cardList.addCard(card);
+ }
+
+ public String getName() {
+ return this.name.getName();
+ }
+
+ public int getScore() {
+ return this.cardList.calculateScore();
+ }
+
+ public List getCardList() {
+ return this.cardList.getCardList();
+ }
+
+}
diff --git a/src/main/java/participant/Player.java b/src/main/java/participant/Player.java
new file mode 100644
index 000000000..78cb14882
--- /dev/null
+++ b/src/main/java/participant/Player.java
@@ -0,0 +1,12 @@
+package participant;
+
+public class Player extends Participant{
+ public Player(Name name) {
+ super(name);
+ }
+
+ @Override
+ public boolean isDealer() {
+ return false;
+ }
+}
diff --git a/src/main/java/participant/PlayerList.java b/src/main/java/participant/PlayerList.java
new file mode 100644
index 000000000..ad1b342e4
--- /dev/null
+++ b/src/main/java/participant/PlayerList.java
@@ -0,0 +1,46 @@
+package participant;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PlayerList {
+
+ private List playerList;
+
+ public PlayerList(List playerNameList) {
+ List nameList = hasDuplicateNames(playerNameList);
+ this.playerList = generatePlayerList(nameList);
+ }
+
+ private void IsNameEqualsDealer(String name) {
+ if (name.equals("๋๋ฌ")) {
+ throw new IllegalArgumentException("๋๋ฌ ์ด๋ฆ ์ฌ์ฉ ๋ถ๊ฐ");
+ }
+ }
+
+ private List hasDuplicateNames(List playerNameList) {
+ List processedNameList = new ArrayList();
+ for (String name : playerNameList) {
+ String trimmedName = name.trim();
+ if (processedNameList.contains(trimmedName)) {
+ throw new IllegalArgumentException("์ด๋ฆ ์ค๋ณต");
+ }
+ processedNameList.add(trimmedName);
+ }
+ return processedNameList;
+ }
+
+ private List generatePlayerList(List processedNameList) {
+ List playerList = new ArrayList();
+ for (String name : processedNameList) {
+ IsNameEqualsDealer(name);
+ playerList.add(new Player(new Name(name)));
+ }
+ return playerList;
+ }
+
+ public List getPlayerList() {
+ return this.playerList;
+ }
+
+}
diff --git a/src/main/java/view/InputView.java b/src/main/java/view/InputView.java
new file mode 100644
index 000000000..2290d63ef
--- /dev/null
+++ b/src/main/java/view/InputView.java
@@ -0,0 +1,43 @@
+package view;
+
+import constants.Constant;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Scanner;
+
+public class InputView {
+
+ private Scanner sc;
+
+ public InputView() {
+ this.sc = new Scanner(System.in);
+ }
+
+ public List inputPlayerName() {
+ String playerNameStr = this.sc.nextLine();
+ if (playerNameStr.isBlank()) {
+ throw new IllegalArgumentException("๊ฐ์ ์
๋ ฅํ์์ค.");
+ }
+ List list = Arrays.asList(playerNameStr.split(","));
+ List playerNameList = new ArrayList();
+ for (String name : list) {
+ playerNameList.add(name.trim());
+ }
+ return playerNameList;
+ }
+
+ public String askForAdditionalCard() {
+ String answer = this.sc.nextLine();
+ validateAnswer(answer);
+ return answer;
+ }
+
+ private void validateAnswer(String value) {
+ if (!(value.equals(Constant.YES) || value.equals(Constant.NO))) {
+ throw new IllegalArgumentException("y ๋๋ n์ ์
๋ ฅํ์์ค.");
+ }
+ }
+
+}
diff --git a/src/main/java/view/OutputView.java b/src/main/java/view/OutputView.java
new file mode 100644
index 000000000..37c4befe3
--- /dev/null
+++ b/src/main/java/view/OutputView.java
@@ -0,0 +1,98 @@
+package view;
+
+import carddeck.Card;
+import participant.Dealer;
+import participant.Participant;
+import participant.Player;
+
+import java.util.HashMap;
+import java.util.List;
+
+public class OutputView {
+ public void printInputPlayerNameMessage() {
+ System.out.println("๊ฒ์์ ์ฐธ์ฌํ ์ฌ๋์ ์ด๋ฆ์ ์
๋ ฅํ์ธ์.(์ผํ ๊ธฐ์ค์ผ๋ก ๋ถ๋ฆฌ)");
+ }
+
+ public void printInitialCardDistributionMessage(List names) {
+ StringBuilder stringBuilder = new StringBuilder();
+ for (int i = 0; i < names.size(); i++) {
+ stringBuilder.append(names.get(i));
+ if (i < names.size() - 1) {
+ stringBuilder.append(", ");
+ }
+ }
+ System.out.printf("\n๋๋ฌ์ %s์๊ฒ 2์ฅ์ ๋๋์์ต๋๋ค.\n", stringBuilder);
+ }
+
+ public void printParticipantCardList(Participant participant) {
+ List cardList = participant.getCardList();
+ StringBuilder stringBuilder = new StringBuilder();
+ if (participant instanceof Player) {
+ stringBuilder.append(participant.getName()).append("์นด๋: ");
+ }
+ if (participant instanceof Dealer) {
+ stringBuilder.append(participant.getName()).append(": ");
+ }
+ stringBuilder.append(cardListString(cardList));
+ System.out.println(stringBuilder);
+ }
+
+ private StringBuilder cardListString(List cardList) {
+ StringBuilder stringBuilder = new StringBuilder();
+ for (int i = 0; i < cardList.size(); i++) {
+ stringBuilder.append(cardList.get(i).toString());
+ if (i < cardList.size() - 1) {
+ stringBuilder.append(", ");
+ }
+ }
+ return stringBuilder;
+ }
+
+ public void printEmptyLine() {
+ System.out.println();
+ }
+
+ public void printAskForAdditionalCard(String name) {
+ System.out.printf("%s๋ ํ์ฅ์ ์นด๋๋ฅผ ๋ ๋ฐ๊ฒ ์ต๋๊น?(์๋ y, ์๋์ค๋ n)\n", name);
+ }
+
+ public void printDealerGetOneMoreCard() {
+ System.out.println("๋๋ฌ๋ 16์ดํ๋ผ ํ์ฅ์ ์นด๋๋ฅผ ๋ ๋ฐ์์ต๋๋ค.\n");
+ }
+
+ public void printScore(Participant participant, int score) {
+ List cardList = participant.getCardList();
+ StringBuilder stringBuilder = new StringBuilder();
+ if (participant instanceof Player) {
+ stringBuilder.append(participant.getName()).append("์นด๋: ");
+ }
+ if (participant instanceof Dealer) {
+ stringBuilder.append(participant.getName()).append(" ์นด๋: ");
+ }
+ stringBuilder.append(cardListString(cardList).append(" - ๊ฒฐ๊ณผ: ").append(score));
+ System.out.println(stringBuilder);
+ }
+
+ public void printFinalResult(List dealerResult, HashMap playerResult) {
+ System.out.println("## ์ต์ข
์นํจ");
+ System.out.println(getDealerString(dealerResult));
+ for (String name : playerResult.keySet()) {
+ System.out.println(name + ": " + playerResult.get(name));
+ }
+ }
+
+ private StringBuilder getDealerString(List dealerResult) {
+ StringBuilder dealerString = new StringBuilder();
+ dealerString.append("๋๋ฌ: ");
+ if (dealerResult.get(0) > 0) {
+ dealerString.append(dealerResult.get(0)).append("์น ");
+ }
+ if (dealerResult.get(1) > 0) {
+ dealerString.append(dealerResult.get(1)).append("ํจ ");
+ }
+ if (dealerResult.get(2) > 0) {
+ dealerString.append(dealerResult.get(2)).append("๋ฌด์น๋ถ");
+ }
+ return dealerString;
+ }
+}
diff --git a/src/test/java/test.java b/src/test/java/test.java
new file mode 100644
index 000000000..53ba7f616
--- /dev/null
+++ b/src/test/java/test.java
@@ -0,0 +1,2 @@
+public class test {
+}