diff --git a/README.md b/README.md
index 15bb106b5..8668f48f7 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,63 @@
-# javascript-lotto-precourse
+# ๐ธ ๋ก๋ ๊ธฐ๋ฅ ๊ตฌํ
+
+
+[๐ฃ ์
๋ ฅ๋ฐ๊ณ ์ฒ๋ฆฌํ๊ธฐ](#๊ตฌ์
-๊ธ์ก-์
๋ ฅ)
+[๐ฐ ๋ฐํํ๊ธฐ](#๋ฐํํ๊ธฐ)
+[๐ ๋น์ฒจ ๊ณ์ฐํ๊ธฐ](#๋น์ฒจ)
+[๐ ์์ต๋ฅ ](#-์์ต๋ฅ )
+[๐ค ์ถ๋ ฅํ๊ธฐ](#-์ถ๋ ฅํ๊ธฐ)
+
+
+## ๐ฃ ์
๋ ฅ ๋ฐ๊ณ ์ฒ๋ฆฌํ๊ธฐ
+### ๊ตฌ์
๊ธ์ก ์
๋ ฅ
+
+1000์ ๋จ์๋ก ๋๋์ด ๋จ์ด์ง์ง ์์ผ๋ฉด ์์ธ ์ฒ๋ฆฌํ๋ค.
+
+- `[ERROR] ๊ตฌ์
๊ธ์ก์ด 1000 ๋จ์๋ก ๋๋์ด ๋จ์ด์ง์ง ์์ต๋๋ค.`
+
+### ๋น์ฒจ ๋ฒํธ, ๋ณด๋์ค ๋ฒํธ ์
๋ ฅ
+
+๋น์ฒจ ๋ฒํธ๋ฅผ ์
๋ ฅํ๋ค. ์ด๋ ์ผํ๋ก ๊ตฌ๋ถํ๋ค.
+- ์ค๋ณต๋์ง ์๋ ์ซ์ 6๊ฐ์ ๋ณด๋์ค ๋ฒํธ 1๊ฐ๋ฅผ ๋ฝ๋๋ค.
+
+- ์์ธ : **๋น์ฒจ ๋ฒํธ๋ฅผ 6๊ฐ ์
๋ ฅํ์ง ์์ ๊ฒฝ์ฐ** :
`[ERROR] ๋น์ฒจ ๋ฒํธ๋ฅผ 6๊ฐ ์
๋ ฅํด์ผํฉ๋๋ค.`
+- ์์ธ : **์ค๋ณต๋๋ ๊ฒฝ์ฐ** :
`[ERROR] ๋ก๋ ๋ฒํธ๋ ์ค๋ณต ์๋ 6๊ฐ์ ์ซ์์ฌ์ผ ํฉ๋๋ค.`
+- ์์ธ : **์ซ์ ๋ฒ์๋ฅผ ๋ฒ์ด๋ ๊ฒฝ์ฐ** :
`[ERROR] ๋ก๋ ๋ฒํธ๋ 1๋ถํฐ 45 ์ฌ์ด์ ์ซ์์ฌ์ผ ํฉ๋๋ค.`
+
+๋ณด๋์ค ๋ฒํธ๋ฅผ ์
๋ ฅํ๋ค.
+- ์์ธ : **๋ณด๋์ค ๋ฒํธ๊ฐ 1๊ฐ๊ฐ ์๋ ๊ฒฝ์ฐ** :
`[ERROR] ๋ณด๋์ค ๋ฒํธ๋ฅผ 1๊ฐ ์
๋ ฅํด์ผํฉ๋๋ค.`
+- ์์ธ : **๋น์ฒจ ๋ฒํธ์ ์ค๋ณต๋๋ ๊ฒฝ์ฐ**:
`[ERROR] ๋น์ฒจ ๋ฒํธ์ ์ค๋ณต๋ ์ซ์๋ฅผ ์
๋ ฅํ์ต๋๋ค.`
+- ์์ธ : **์ซ์ ๋ฒ์๋ฅผ ๋ฒ์ด๋ ๊ฒฝ์ฐ** :
`[ERROR] ๋ก๋ ๋ฒํธ๋ 1๋ถํฐ 45 ์ฌ์ด์ ์ซ์์ฌ์ผ ํฉ๋๋ค.`
+
+## ๐ฐ ๋ฐํํ๊ธฐ
+
+๋๋ ์ซ์๋งํผ ๋ก๋๋ฅผ ๋ฐํํ๋ค.
+- ๋ก๋ ๋ฒํธ์ ์ซ์ ๋ฒ์ : 1-45
+
+ํ ๋ฒ ๋ฐํํ ๋ ์ซ์์ ๊ฐ์๋ 6๊ฐ ์ด๋ค.
+
+
+## ๐ ๋น์ฒจ ๊ณ์ฐํ๊ธฐ
+
+1๋ฑ ๋ถํฐ 5๋ฑ๊น์ง ์๊ตฌ ์ฌํญ์ ๋ฐ๋ผ ๋น์ฒจ์๋ฅผ ๊ฐ๋ฆฐ๋ค.
+- 6๊ฐ ์ผ์น์ 5๊ฐ ์ผ์น์ ๋ณด๋์ค ๋ณผ ์ผ์นํ๋ ๊ฒฝ์ฐ๋ฅผ ์ ๊ตฌ๋ถํด์ผํ๋ค.
+- 3๊ฐ, 4๊ฐ, 5๊ฐ, 5๊ฐ๋ ๋ณด๋์ค ๋ง์ถ๊ฒฝ์ฐ, 6๊ฐ๋ก ๋๋๊ณ `if-else`์กฐ๊ฑด๋ฌธ์ผ๋ก ํด๊ฒฐ(ํน์ ๊ฒฝ์ฐ์๋ง ์กฐ๊ฑด์ ์ํํ๊ณ ์ด ํ ์กฐ๊ฑด ๋ฌด์ํ๊ธฐ ๋๋ฌธ์ ์ฌ์ฉํ์ต๋๋ค.)
+
+
+## ๐ ์์ต๋ฅ
+
+- $(๋น์ฒจย ์ดย ๊ธ์ก/๊ตฌ์
ย ๊ธ์ก) ร 100 = ์์ต๋ฅ $
+- ์์์ **๋์งธ์๋ฆฌ**์์ ๋ฐ์ฌ๋ฆผ
+
+
+
+## ๐ค ์ถ๋ ฅํ๊ธฐ
+
+- ๋ฐํํ ๋ก๋ ์๋๊ณผ ๋ฒํธ๋ฅผ ์ถ๋ ฅํ๋ค.
+- ์ค๋ฆ์ฐจ์์ผ๋ก ์ ๋ ฌํ์ฌ ๋ณด์ฌ์ค๋ค.
+
+- ๋น์ฒจ ๋ด์ญ์ ์ถ๋ ฅํ๋ค.
+- 0๊ฐ ์ผ์น, (00000์) - 0๊ฐ
+- ์์ต๋ฅ ์์์ ๋์งธ ์๋ฆฌ์์ ๋ฐ์ฌ๋ฆผํ๋ค.
+
+- ์์ธ ์ฌํญ ์ ์๋ฌ ๋ฌธ๊ตฌ ์ถ๋ ฅํด์ผํ๋ค.
diff --git a/__tests__/ApplicationTest.js b/__tests__/ApplicationTest.js
index 872380c9c..8390d0be4 100644
--- a/__tests__/ApplicationTest.js
+++ b/__tests__/ApplicationTest.js
@@ -1,4 +1,4 @@
-import App from "../src/App.js";
+import App from "../src/controllers/App.js";
import { MissionUtils } from "@woowacourse/mission-utils";
const mockQuestions = (inputs) => {
@@ -6,7 +6,6 @@ const mockQuestions = (inputs) => {
MissionUtils.Console.readLineAsync.mockImplementation(() => {
const input = inputs.shift();
-
return Promise.resolve(input);
});
};
@@ -91,7 +90,5 @@ describe("๋ก๋ ํ
์คํธ", () => {
});
});
- test("์์ธ ํ
์คํธ", async () => {
- await runException("1000j");
- });
+
});
diff --git a/__tests__/InputValidatorTest.js b/__tests__/InputValidatorTest.js
new file mode 100644
index 000000000..87a4a4b8b
--- /dev/null
+++ b/__tests__/InputValidatorTest.js
@@ -0,0 +1,45 @@
+import InputValidator from "../src/utils/InputValidator";
+
+describe('์
๋ ฅ ๊ฐ ์ ํจ์ฑ ํ
์คํธ', () => {
+ test("๊ตฌ์
๊ธ์ก์ด 1000์ ๋จ์๊ฐ ์๋ ๊ฒฝ์ฐ ์์ธ ์ฒ๋ฆฌ", () => {
+ expect(() => {
+ InputValidator.PurchaseAmount("1500");
+ }).toThrow("[ERROR] ๊ตฌ์
๊ธ์ก์ด 1000 ๋จ์๋ก ๋๋์ด ๋จ์ด์ง์ง ์์ต๋๋ค.");
+ });
+
+ test("๋น์ฒจ ๋ฒํธ๊ฐ ๋ฒ์๋ฅผ ๋ฒ์ด๋ ๋ ์์ธ ์ฒ๋ฆฌ", () => {
+ expect(() => {
+ InputValidator.WinningNumbers("1,2,3,4,5,46");
+ }).toThrow("[ERROR]");
+ });
+
+ test("๋น์ฒจ ๋ฒํธ๊ฐ 6๊ฐ๊ฐ ์๋ ๋ ์์ธ ์ฒ๋ฆฌ", () => {
+ expect(() => {
+ InputValidator.WinningNumbers("1,2,3,4,5");
+ }).toThrow("[ERROR]");
+ });
+
+ test("๋น์ฒจ ๋ฒํธ์ ์ค๋ณต๋ ์ซ์๊ฐ ์์ ๋ ์์ธ ์ฒ๋ฆฌ", () => {
+ expect(() => {
+ InputValidator.WinningNumbers("1,2,3,4,5,5");
+ }).toThrow("[ERROR]");
+ });
+
+ test("๋ณด๋์ค ๋ฒํธ๊ฐ 1๊ฐ๊ฐ ์๋ ๋ ์์ธ ์ฒ๋ฆฌ", () => {
+ expect(() => {
+ InputValidator.bonusNumber("7,8", [1, 2, 3, 4, 5, 6]);
+ }).toThrow("[ERROR] ๋ณด๋์ค ๋ฒํธ๋ฅผ 1๊ฐ ์
๋ ฅํด์ผ ํฉ๋๋ค.");
+ });
+
+ test("๋ณด๋์ค ๋ฒํธ๊ฐ ๋น์ฒจ ๋ฒํธ์ ์ค๋ณต๋ ๋ ์์ธ ์ฒ๋ฆฌ", () => {
+ expect(() => {
+ InputValidator.bonusNumber("5", [1, 2, 3, 4, 5, 6]);
+ }).toThrow("[ERROR] ๋น์ฒจ ๋ฒํธ์ ์ค๋ณต๋ ์ซ์๋ฅผ ์
๋ ฅํ์ต๋๋ค.");
+ });
+
+ test("๋ณด๋์ค ๋ฒํธ๊ฐ ๋ฒ์๋ฅผ ๋ฒ์ด๋ ๋ ์์ธ ์ฒ๋ฆฌ", () => {
+ expect(() => {
+ InputValidator.bonusNumber("50", [1, 2, 3, 4, 5, 6]);
+ }).toThrow("[ERROR] ๋ก๋ ๋ฒํธ๋ 1๋ถํฐ 45 ์ฌ์ด์ ์ซ์์ฌ์ผ ํฉ๋๋ค.");
+ });
+});
diff --git a/__tests__/LottoTest.js b/__tests__/LottoTest.js
index 409aaf69b..0af31be43 100644
--- a/__tests__/LottoTest.js
+++ b/__tests__/LottoTest.js
@@ -1,4 +1,4 @@
-import Lotto from "../src/Lotto";
+import Lotto from "../src/models/Lotto";
describe("๋ก๋ ํด๋์ค ํ
์คํธ", () => {
test("๋ก๋ ๋ฒํธ์ ๊ฐ์๊ฐ 6๊ฐ๊ฐ ๋์ด๊ฐ๋ฉด ์์ธ๊ฐ ๋ฐ์ํ๋ค.", () => {
@@ -14,5 +14,12 @@ describe("๋ก๋ ํด๋์ค ํ
์คํธ", () => {
}).toThrow("[ERROR]");
});
- // TODO: ์ถ๊ฐ ๊ธฐ๋ฅ ๊ตฌํ์ ๋ฐ๋ฅธ ํ
์คํธ ์ฝ๋ ์์ฑ
+ test("๋ก๋ ๋ฒํธ๊ฐ 1~45 ๋ฒ์๋ฅผ ๋ฒ์ด๋๋ฉด ์์ธ๊ฐ ๋ฐ์ํ๋ค.", () => {
+ expect(() => {
+ new Lotto([0, 2, 3, 4, 5, 6]);
+ }).toThrow("[ERROR] ๋ก๋ ๋ฒํธ๋ 1๋ถํฐ 45 ์ฌ์ด์ ์ซ์์ฌ์ผ ํฉ๋๋ค.");
+ expect(() => {
+ new Lotto([1, 2, 3, 4, 5, 46]);
+ }).toThrow("[ERROR] ๋ก๋ ๋ฒํธ๋ 1๋ถํฐ 45 ์ฌ์ด์ ์ซ์์ฌ์ผ ํฉ๋๋ค.");
+ });
});
diff --git a/src/App.js b/src/App.js
deleted file mode 100644
index 091aa0a5d..000000000
--- a/src/App.js
+++ /dev/null
@@ -1,5 +0,0 @@
-class App {
- async run() {}
-}
-
-export default App;
diff --git a/src/Lotto.js b/src/Lotto.js
deleted file mode 100644
index cb0b1527e..000000000
--- a/src/Lotto.js
+++ /dev/null
@@ -1,18 +0,0 @@
-class Lotto {
- #numbers;
-
- constructor(numbers) {
- this.#validate(numbers);
- this.#numbers = numbers;
- }
-
- #validate(numbers) {
- if (numbers.length !== 6) {
- throw new Error("[ERROR] ๋ก๋ ๋ฒํธ๋ 6๊ฐ์ฌ์ผ ํฉ๋๋ค.");
- }
- }
-
- // TODO: ์ถ๊ฐ ๊ธฐ๋ฅ ๊ตฌํ
-}
-
-export default Lotto;
diff --git a/src/controllers/App.js b/src/controllers/App.js
new file mode 100644
index 000000000..08e9cfe2d
--- /dev/null
+++ b/src/controllers/App.js
@@ -0,0 +1,48 @@
+import { Console } from "@woowacourse/mission-utils";
+import LottoManager from "../models/LottoManager.js";
+import InputValidator from "../utils/InputValidator.js";
+import ConsoleView from "../views/ConsoleView.js";
+
+class App {
+ async run() {
+ ConsoleView.askPurchaseAmount((input) => this.handlePurchaseAmount(input));
+ }
+
+ handlePurchaseAmount(input) {
+ try {
+ const purchaseAmount = InputValidator.PurchaseAmount(input);
+ console.log("๊ตฌ์
๊ธ์ก ์ ํจ์ฑ ํต๊ณผ:", purchaseAmount); // ๋๋ฒ๊น
๋ก๊ทธ
+ this.lottoManager = new LottoManager(purchaseAmount);
+ ConsoleView.showLottos(this.lottoManager.getLottos());
+ ConsoleView.askWinningNumbers((input) => this.handleWinningNumbers(input));
+ } catch (error) {
+ ConsoleView.showError(error);
+ ConsoleView.askPurchaseAmount((input) => this.handlePurchaseAmount(input));
+ }
+ }
+
+ handleWinningNumbers(input) {
+ try {
+ const winningNumbers = InputValidator.WinningNumbers(input);
+ console.log("๋น์ฒจ ๋ฒํธ ์ ํจ์ฑ ํต๊ณผ:", winningNumbers); // ๋๋ฒ๊น
๋ก๊ทธ
+ ConsoleView.askBonusNumber((input) => this.handleBonusNumber(input, winningNumbers));
+ } catch (error) {
+ ConsoleView.showError(error);
+ ConsoleView.askWinningNumbers((input) => this.handleWinningNumbers(input));
+ }
+ }
+
+ handleBonusNumber(input, winningNumbers) {
+ try {
+ const bonusNumber = InputValidator.BonusNumber(input);
+ console.log("๋ณด๋์ค ๋ฒํธ ์ ํจ์ฑ ํต๊ณผ:", bonusNumber); // ๋๋ฒ๊น
๋ก๊ทธ
+ const results = this.lottoManager.calculateResults(winningNumbers, bonusNumber);
+ ConsoleView.showResults(results);
+ } catch (error) {
+ ConsoleView.showError(error);
+ ConsoleView.askBonusNumber((input) => this.handleBonusNumber(input, winningNumbers));
+ }
+ }
+}
+
+export default App;
diff --git a/src/index.js b/src/index.js
index 02a1d389e..2a799ed85 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,4 +1,4 @@
-import App from "./App.js";
+import App from "./controllers/App.js";
const app = new App();
await app.run();
diff --git a/src/models/Lotto.js b/src/models/Lotto.js
new file mode 100644
index 000000000..979eb751f
--- /dev/null
+++ b/src/models/Lotto.js
@@ -0,0 +1,28 @@
+class Lotto {
+ #numbers;
+
+ constructor(numbers) {
+ this.#validate(numbers);
+ this.#numbers = numbers;
+ }
+
+ #validate(numbers) {
+ if (numbers.length !== 6) {
+ throw new Error("[ERROR] ๋ก๋ ๋ฒํธ๋ 6๊ฐ์ฌ์ผ ํฉ๋๋ค.");
+ }
+ if (new Set(numbers).size !== numbers.length){
+ throw new Error("[ERROR] ๋ก๋ ๋ฒํธ๋ ์ค๋ณต ์๋ 6๊ฐ์ ์ซ์์ฌ์ผ ํฉ๋๋ค.")
+ }
+ if (numbers.some(num => num < 1 || num > 45)){
+ throw new Error("[ERROR] ๋ก๋ ๋ฒํธ๋ 1๋ถํฐ 45 ์ฌ์ด์ ์ซ์์ฌ์ผ ํฉ๋๋ค.")
+ }
+ }
+
+ // TODO: ์ถ๊ฐ ๊ธฐ๋ฅ ๊ตฌํ
+
+ getNumbers(){
+ return this.#numbers;
+ }
+}
+
+export default Lotto;
diff --git a/src/models/LottoManager.js b/src/models/LottoManager.js
new file mode 100644
index 000000000..2f0c40aac
--- /dev/null
+++ b/src/models/LottoManager.js
@@ -0,0 +1,27 @@
+import Lotto from "./Lotto.js";
+import { Random } from "@woowacourse/mission-utils";
+import ResultCalculator from "./ResultCalculator.js";
+
+class LottoManager {
+ constructor(purchaseAmount) {
+ this.lottos = this.generateLottos(purchaseAmount / 1000);
+ }
+
+ generateLottos(count) {
+ return Array.from({ length: count }, () => {
+ const numbers = Random.pickUniqueNumbersInRange(1, 45, 6).sort((a, b) => a - b);
+ return new Lotto(numbers);
+ });
+ }
+
+ getLottos() {
+ return this.lottos;
+ }
+
+ calculateResults(winningNumbers, bonusNumber) {
+ const resultCalculator = new ResultCalculator(this.lottos, winningNumbers, bonusNumber);
+ return resultCalculator.getResults();
+ }
+}
+
+export default LottoManager;
diff --git a/src/models/ResultCalculator.js b/src/models/ResultCalculator.js
new file mode 100644
index 000000000..233c79c61
--- /dev/null
+++ b/src/models/ResultCalculator.js
@@ -0,0 +1,35 @@
+class ResultCalculator {
+ constructor(lottos, winningNumbers, bonusNumber) {
+ this.lottos = lottos;
+ this.winningNumbers = winningNumbers;
+ this.bonusNumber = bonusNumber;
+ this.matchCounts = { 3: 0, 4: 0, 5: 0, 6: 0, "5+bonus": 0 };
+ this.calculateResults();
+ }
+
+ calculateResults() {
+ this.lottos.forEach((lotto) => {
+ const matchedCount = this.countMatches(lotto.getNumbers());
+ this.updateMatchCounts(matchedCount, lotto);
+ });
+ }
+
+ countMatches(numbers) {
+ return numbers.filter((num) => this.winningNumbers.includes(num)).length;
+ }
+
+ updateMatchCounts(matchedCount, lotto) {
+ if (matchedCount === 6) this.matchCounts[6]++;
+ else if (matchedCount === 5 && lotto.getNumbers().includes(this.bonusNumber)) this.matchCounts["5+bonus"]++;
+ else if (matchedCount === 5) this.matchCounts[5]++;
+ else if (matchedCount === 4) this.matchCounts[4]++;
+ else if (matchedCount === 3) this.matchCounts[3]++;
+ }
+
+ getResults() {
+ return this.matchCounts;
+ }
+ }
+
+ export default ResultCalculator;
+
\ No newline at end of file
diff --git a/src/utils/InputValidator.js b/src/utils/InputValidator.js
new file mode 100644
index 000000000..d84f5c84e
--- /dev/null
+++ b/src/utils/InputValidator.js
@@ -0,0 +1,42 @@
+import Lotto from "../models/Lotto.js";
+
+class InputValidator {
+ static PurchaseAmount(input) {
+ const amount = parseInt(input, 10);
+ if (isNaN(amount) || amount % 1000 !== 0) {
+ throw new Error("[ERROR] ๊ตฌ์
๊ธ์ก์ด 1000 ๋จ์๋ก ๋๋์ด ๋จ์ด์ง์ง ์์ต๋๋ค.");
+ }
+ return amount;
+ }
+
+ static WinningNumbers(input) {
+ const numbers = input.split(",").map(Number);
+ const lotto = new Lotto(numbers);
+ return lotto.getNumbers();
+ }
+
+ static bonusNumber(input, winningNumbers) {
+ const numbers = input.split(',').map(Number);
+ this.checkBonusNumberCount(numbers);
+ const bonusNumber = numbers[0];
+ this.checkBonusNumberValidity(bonusNumber, winningNumbers);
+ return bonusNumber;
+ }
+
+ static checkBonusNumberCount(numbers) {
+ if (numbers.length !== 1) {
+ throw new Error("[ERROR] ๋ณด๋์ค ๋ฒํธ๋ฅผ 1๊ฐ ์
๋ ฅํด์ผ ํฉ๋๋ค.");
+ }
+ }
+
+ static checkBonusNumberValidity(bonusNumber, winningNumbers) {
+ if (winningNumbers.includes(bonusNumber)) {
+ throw new Error("[ERROR] ๋น์ฒจ ๋ฒํธ์ ์ค๋ณต๋ ์ซ์๋ฅผ ์
๋ ฅํ์ต๋๋ค.");
+ }
+ if (isNaN(bonusNumber) || bonusNumber < 1 || bonusNumber > 45) {
+ throw new Error("[ERROR] ๋ก๋ ๋ฒํธ๋ 1๋ถํฐ 45 ์ฌ์ด์ ์ซ์์ฌ์ผ ํฉ๋๋ค.");
+ }
+ }
+}
+
+export default InputValidator;
diff --git a/src/views/ConsoleView.js b/src/views/ConsoleView.js
new file mode 100644
index 000000000..d811e9023
--- /dev/null
+++ b/src/views/ConsoleView.js
@@ -0,0 +1,43 @@
+import { Console } from "@woowacourse/mission-utils";
+
+const ConsoleView = {
+ askPurchaseAmount() {
+ return new Promise((resolve) => {
+ Console.readLineAsync("๊ตฌ์
๊ธ์ก์ ์
๋ ฅํด ์ฃผ์ธ์.\n", resolve);
+ });
+ },
+
+ askWinningNumbers() {
+ return new Promise((resolve) => {
+ Console.readLineAsync("๋น์ฒจ ๋ฒํธ๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์.\n", resolve);
+ });
+ },
+
+ askBonusNumber() {
+ return new Promise((resolve) => {
+ Console.readLineAsync("๋ณด๋์ค ๋ฒํธ๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์.\n", resolve);
+ });
+ },
+
+ showLottos(lottos) {
+ Console.print(`${lottos.length}๊ฐ๋ฅผ ๊ตฌ๋งคํ์ต๋๋ค.`);
+ lottos.forEach((lotto) => {
+ Console.print(`[${lotto.getNumbers().join(", ")}]`);
+ });
+ },
+
+ showResults(results) {
+ Console.print("๋น์ฒจ ํต๊ณ\n---");
+ Console.print(`3๊ฐ ์ผ์น (5,000์) - ${results[3]}๊ฐ`);
+ Console.print(`4๊ฐ ์ผ์น (50,000์) - ${results[4]}๊ฐ`);
+ Console.print(`5๊ฐ ์ผ์น (1,500,000์) - ${results[5]}๊ฐ`);
+ Console.print(`5๊ฐ ์ผ์น, ๋ณด๋์ค ๋ณผ ์ผ์น (30,000,000์) - ${results["5+bonus"]}๊ฐ`);
+ Console.print(`6๊ฐ ์ผ์น (2,000,000,000์) - ${results[6]}๊ฐ`);
+ },
+
+ showError(error) {
+ Console.print(`[ERROR] ${error.message}`);
+ },
+};
+
+export default ConsoleView;