code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -0,0 +1,57 @@
+package racingcar.view;
+
+import racingcar.model.Car;
+import racingcar.model.CarName;
+import racingcar.model.Cars;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class OutputView {
+
+ private static final String NEW_LINE = "\n";
+ private static final String SCORE_U... | Java | ์ ๋ ๊ฐ์ธ์ ์ผ๋ก MVC ์์ View๋ ์ปจํธ๋กค๋ฌ๋ก๋ถํฐ ๋์ ์ธ ์ ๋ณด๋ง ๋ฐ์์ผ ํ๋ค๊ณ ์๊ฐํ๋๋ฐ์! ํน์ ์ด๋ฐ ์ ๊ทผ ๋ฐฉ๋ฒ์ ์ด๋ ์ค๊น์?
์ ๊ฐ ์ด๋ ๊ฒ ์๊ฐํ๋ ์ด์ ๋, ๊ด์ฌ์ฌ๊ฐ ๋ค๋ฅด๊ธฐ ๋๋ฌธ์
๋๋ค.
์๋ฌ ์ฒ๋ฆฌ์ ๊ดํ ์ถ๋ ฅ์ ํด๋น try-catch ๋ธ๋ก์ ์ฑ
์์ด ์๋ค๊ณ ์๊ฐํด์.
์ฌ์ค ์ ๋ต์ ์๋ ๊ฒ ๊ฐ์ผ๋, ์ ๊ฐ ๊ณ ์ํ๋ ๋ฐฉ๋ฒ์ ์ด๋ค์ง ์ ์๋๋ ค ๋ด
๋๋ค. |
@@ -0,0 +1,47 @@
+package racingcar.model;
+
+public class Car implements Comparable<Car> {
+ private static final int MOVABLE_LOWER_BOUND = 4;
+
+ private final CarName name;
+ private final Position position = Position.init();
+
+ private Car(String name) {
+ this.name = CarName.from(name);
+ }
... | Java | ์ ๋ ๋ฐฐ์๊ฐ๋๋ค!! ์ด๋ฐ ์์ผ๋ก ๋น๊ต๋ ๊ฐ๋ฅํ๊ตฐ์.. |
@@ -0,0 +1,52 @@
+package racingcar.model;
+
+import java.util.Objects;
+
+public class CarName {
+
+ private static final String INVALID_NAME_LENGTH = "์๋์ฐจ ์ด๋ฆ์ 5์๋ฅผ ์ด๊ณผํ ์ ์์ต๋๋ค.";
+ private static final int NAME_LENGTH_UPPER_BOUND = 5;
+
+ private final String name;
+
+ public CarName(String name) {
+ ... | Java | hashCode๊ฐ ์ฌ์ฉ๋์ง ์๋ ๊ฒ ๊ฐ์, ๋ฐ๋ก ์ค๋ฒ๋ผ์ด๋ฉ ํ์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค! |
@@ -0,0 +1,52 @@
+package racingcar.model;
+
+import java.util.Objects;
+
+public class CarName {
+
+ private static final String INVALID_NAME_LENGTH = "์๋์ฐจ ์ด๋ฆ์ 5์๋ฅผ ์ด๊ณผํ ์ ์์ต๋๋ค.";
+ private static final int NAME_LENGTH_UPPER_BOUND = 5;
+
+ private final String name;
+
+ public CarName(String name) {
+ ... | Java | get ๋ฉ์๋๊ฐ toString๊ณผ ์ค๋ณต๋๋ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,63 @@
+package racingcar.cotroller;
+
+import racingcar.RandomRacingNumberGenerator;
+import racingcar.model.AttemptCount;
+import racingcar.model.Cars;
+import racingcar.view.InputView;
+import racingcar.view.OutputView;
+
+import java.util.List;
+import java.util.function.Supplier;
+
+public class RacingCa... | Java | ๋ฐ๋ก ์ปจํธ๋กค๋ฌ์์ RandomRacingNumberGenerator๋ฅผ ์ฃผ์
ํด์ฃผ์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค.
์ ์๊ฐ์๋, RandomRacingNumberGenerator๋ฅผ race ๋ฉ์๋ ๋ด์์ ์ ์ธํ๋ฉด ์ปจํธ๋กค๋ฌ์์ ์์์ผ ํ ๊ด์ฌ์ฌ๊ฐ ํ๋ ์ค์ด๋๋ ์ด์ ์ด ์์ ๊ฒ ๊ฐ์์์! |
@@ -1,29 +1,51 @@
package lotto.domain;
-import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
+import java.util.stream.Collectors;
public class Lotto {
- private List<Integer> lotto;
+ private List<LottoNumber> lotto;
- public Lotto(List<Integer> list) {
- lotto = n... | Java | ๋ญ ํฌํจํ๊ณ ์๋ค๋๊ฑฐ์ฃ ? |
@@ -1,29 +1,51 @@
package lotto.domain;
-import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
+import java.util.stream.Collectors;
public class Lotto {
- private List<Integer> lotto;
+ private List<LottoNumber> lotto;
- public Lotto(List<Integer> list) {
- lotto = n... | Java | Builder ํจํด๊ณผ ๋ฉ์๋ ์ฒด์ด๋ ๊ณต๋ถํ์๊ณ stringBuilder ๋ค์ ์จ๋ณด์ธ์ |
@@ -1,29 +1,51 @@
package lotto.domain;
-import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
+import java.util.stream.Collectors;
public class Lotto {
- private List<Integer> lotto;
+ private List<LottoNumber> lotto;
- public Lotto(List<Integer> list) {
- lotto = n... | Java | ๊ทธ๋ฆฌ๊ณ ์ ๋ง toString์ ์ด๋ ๊ฒ ๊ตฌํํ์๊ฒ ์ต๋๊น? |
@@ -3,77 +3,78 @@
import lotto.utils.Splitter;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
public class LottoGame {
- private List<Lotto> lottos = new ArrayList<Lotto>();
+ private static final int LOTTO_PRICE = 1000;
+ private List<Lotto> lottos;
+ private List... | Java | text ๋ณด๋ค ์ข์ ๋ค์ด๋ฐ์ด ์์ ๊ฒ ๊ฐ์ต๋๋ค |
@@ -3,77 +3,78 @@
import lotto.utils.Splitter;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
public class LottoGame {
- private List<Lotto> lottos = new ArrayList<Lotto>();
+ private static final int LOTTO_PRICE = 1000;
+ private List<Lotto> lottos;
+ private List... | Java | contrivedNumber ๋ณด๋ค ์ข์ ๋ค์ด๋ฐ์ด ์์ ๊ฒ ๊ฐ์ต๋๋ค |
@@ -3,77 +3,78 @@
import lotto.utils.Splitter;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
public class LottoGame {
- private List<Lotto> lottos = new ArrayList<Lotto>();
+ private static final int LOTTO_PRICE = 1000;
+ private List<Lotto> lottos;
+ private List... | Java | ์ด๋์๋ menual์ด๊ณ ์ฌ๊ธฐ์๋ manual์ด๊ณ ์คํ ๋ง์ด ๋๋์ฒด ๋ญ์ฃ ? |
@@ -0,0 +1,67 @@
+package lotto.domain;
+
+import java.util.Arrays;
+
+public enum Rank {
+ FIRST(6, 2000000000),
+ SECOND(5, 30000000),
+ THIRD(5, 1500000),
+ FOURTH(4, 50000),
+ FIFTH(3, 5000),
+ MISS(0, 0);
+
+ private static final int PRIZE_MIN_NUMBER = 3;
+
+ private int matchCount;
+ pr... | Java | ์ข ๋ ์ข์ ๋ฉ์๋ ๋ค์ด๋ฐ |
@@ -0,0 +1,67 @@
+package lotto.domain;
+
+import java.util.Arrays;
+
+public enum Rank {
+ FIRST(6, 2000000000),
+ SECOND(5, 30000000),
+ THIRD(5, 1500000),
+ FOURTH(4, 50000),
+ FIFTH(3, 5000),
+ MISS(0, 0);
+
+ private static final int PRIZE_MIN_NUMBER = 3;
+
+ private int matchCount;
+ pr... | Java | set์ด๋ผ๋ ๋ช
์นญ์ ํด๋์ค ํ๋๋ค์ ๊ฐ์ ์ธํ
ํ ๋ ์ฌ์ฉํ๋๊น ๋ค๋ฅธ ๋ช
์นญ์ด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค |
@@ -3,77 +3,78 @@
import lotto.utils.Splitter;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
public class LottoGame {
- private List<Lotto> lottos = new ArrayList<Lotto>();
+ private static final int LOTTO_PRICE = 1000;
+ private List<Lotto> lottos;
+ private List... | Java | ์คํ์
๋๋ค |
@@ -3,77 +3,78 @@
import lotto.utils.Splitter;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
public class LottoGame {
- private List<Lotto> lottos = new ArrayList<Lotto>();
+ private static final int LOTTO_PRICE = 1000;
+ private List<Lotto> lottos;
+ private List... | Java | 1000์ด๋ ๊ฐ์ ํ๋์ฝ๋ฉ์ค |
@@ -0,0 +1,17 @@
+package lotto.domain;
+
+public class WinningLotto extends Lotto {
+ private Lotto lotto;
+ private int matchCount;
+ private boolean hasbonusNumber;
+
+ public WinningLotto(Lotto lotto, int matchCount, LottoNumber bonusNumber) {
+ this.hasbonusNumber = lotto.hasThisNumber(bonusNumb... | Java | get set ์ง์๋ณด๊ณ ์๊ฐํด๋ณด์ญ์ผ (๊ฐ์ฒด์งํฅ ์ํ์ฒด์กฐ ๊ท์น get set ์ฌ์ฉ์ ์์ ํ๋ค) |
@@ -3,77 +3,78 @@
import lotto.utils.Splitter;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
public class LottoGame {
- private List<Lotto> lottos = new ArrayList<Lotto>();
+ private static final int LOTTO_PRICE = 1000;
+ private List<Lotto> lottos;
+ private List... | Java | ์ด ํด๋์ค๊ฐ ๋๋ฌด ๋ฌด๊ฑฐ์๋ณด์
๋๋ค. ๋๋ฌด ๋ง์ ์ฑ
์์ ๊ฐ๊ณ ์๋๊ฑด ์๋์ง ํ๋ฒ ๋ด๋ณด์ธ์ |
@@ -0,0 +1,32 @@
+package lotto.domain;
+
+import lotto.utils.Splitter;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class LottoGenerator {
+ List<LottoNumber> randomNumbers;
+
+ public LottoGenerator() {
+ randomNumbers = new ArrayList<>();
+ }
+
+ ... | Java | generateAuto() ๊ฐ ๋ซ์ง ์์๊น์ |
@@ -0,0 +1,32 @@
+package lotto.domain;
+
+import lotto.utils.Splitter;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class LottoGenerator {
+ List<LottoNumber> randomNumbers;
+
+ public LottoGenerator() {
+ randomNumbers = new ArrayList<>();
+ }
+
+ ... | Java | generateMenual ์ด ๋ซ์ง ์์๊น์. menual์ธ์ง manual์ธ์ง ํต์ผ ์์ผ๋ฌ๋ผ๋๊น ๋ฌด์๋นํ๋ค์ |
@@ -15,7 +15,7 @@ const CenterWrapper = styled.div`
overflow: scroll;
height: calc(100dvh - 126px);
align-items: center;
- justigy-content: space-between;
+ justify-content: space-between;
padding-top: 80px;
&::-webkit-scrollbar {
display: none;
@@ -155,47 +155,52 @@ const ReviewPage = () => {
... | Unknown | `handleSubmit`์ ์๋ ๋ฆฌ๋ทฐ ๋ฑ๋ก api ๋ก์ง๋ `review.ts`ํ์ผ์ ๋ถ๋ฆฌํ๋ฉด ๊ฐ๋
์ฑ์ด ๋ ์ข์ ๊ฒ ๊ฐ์์! |
@@ -15,7 +15,7 @@ const CenterWrapper = styled.div`
overflow: scroll;
height: calc(100dvh - 126px);
align-items: center;
- justigy-content: space-between;
+ justify-content: space-between;
padding-top: 80px;
&::-webkit-scrollbar {
display: none;
@@ -155,47 +155,52 @@ const ReviewPage = () => {
... | Unknown | ๊ทธ๋ฆฌ๊ณ ์ฑ๊ณต ์ ํ์ด์ง ์ด๋ ์ฝ๋๊ฐ ๋๋ฝ๋ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -37,14 +37,14 @@ export const showReviewRating = async (
// ์ฐ์ฑ
๋ก ๋ฆฌ๋ทฐ ๋ด์ฉ๋ณด๊ธฐ api
export const showReviewContent = async (
walkwayId: string,
- type: string
+ sort: string
): Promise<{
reviews: ReviewContentType[];
}> => {
try {
const response = await instance.get<
ApiResponseFormat<{ reviews: R... | TypeScript | `showReviewContent` ํธ์ถ ์ ์๋ต์ผ๋ก ๋ฐ์์ค๋ `period` ํ๋๊ฐ ui ์ปดํฌ๋ํธ์ ๋๋ฝ๋ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,79 @@
+import React, { useState } from "react";
+import { useNavigate } from 'react-router-dom';
+import "../../../style/reset.scss";
+import "../../../style/common.scss";
+import "../../../style/variables.scss"
+import "./Login.scss";
+
+
+const Login = () => {
+
+ const [userInfo, setUserInfo] = useSt... | JavaScript | ๐ ์ข์ต๋๋ค! ๊ณ์ํด์ ์ด๋ ๊ฒ ์ธ์
๋ด์ฉ ๋ฐ๋ก๋ฐ๋ก ์ ์ฉํด์ฃผ๋ฉด์ ๋ณธ์ธ์ ์ง์์ผ๋ก ๊ฐ์ ธ๊ฐ์ฃผ์๋ฉด ์ข๊ฒ ์ต๋๋ค! |
@@ -0,0 +1,79 @@
+import React, { useState } from "react";
+import { useNavigate } from 'react-router-dom';
+import "../../../style/reset.scss";
+import "../../../style/common.scss";
+import "../../../style/variables.scss"
+import "./Login.scss";
+
+
+const Login = () => {
+
+ const [userInfo, setUserInfo] = useSt... | JavaScript | ์ฝ๋์ ์ฃผ์์ด ๋ง์ต๋๋ค!
์ถํ์ ๋ค์ ํ์ตํ ์ฉ๋๋ก ๋จ๊ฒจ๋์ ์ฃผ์์ด๋ผ๋ฉด, ํด๋น๋ด์ฉ์ ๋ฐ๋ก ๋ธ๋ก๊ทธ๋ ๊ฐ์ธ ๋ฉ๋ชจ์ ์์ฑ์ ํด ์ฃผ์๊ณ , ์ฝ๋๋ฅผ github์ ํตํด ์ฌ๋ ค์ฃผ์ค๋๋ ๋ถํ์ํ ์ฝ๋๋ฅผ ์ต๋ํ ์ค์ฌ์ฃผ์ธ์! |
@@ -0,0 +1,79 @@
+import React, { useState } from "react";
+import { useNavigate } from 'react-router-dom';
+import "../../../style/reset.scss";
+import "../../../style/common.scss";
+import "../../../style/variables.scss"
+import "./Login.scss";
+
+
+const Login = () => {
+
+ const [userInfo, setUserInfo] = useSt... | JavaScript | ```suggestion
<div className="inputTxt">
```
์ ์ฝ๋ ์ฒ๋ผ js์ ๊ธฐ๋ณธ ์ปจ๋ฒค์
์ `camelCase`์
๋๋ค! className์ ์์ฑํ ๋์๋ ์ ๊ฒฝ์จ์ฃผ์
์ผํฉ๋๋ค! |
@@ -0,0 +1,79 @@
+import React, { useState } from "react";
+import { useNavigate } from 'react-router-dom';
+import "../../../style/reset.scss";
+import "../../../style/common.scss";
+import "../../../style/variables.scss"
+import "./Login.scss";
+
+
+const Login = () => {
+
+ const [userInfo, setUserInfo] = useSt... | JavaScript | ํด๋น scssํ์ผ๋ค์ Index.js์์ import ํด์์ ์ ์ญ์ผ๋ก ์ ์ฉ์ํค๋๊ฒ ์ข์ต๋๋ค. |
@@ -0,0 +1,87 @@
+@import '../../../style/variables.scss';
+@import '../../../style/reset.scss';
+
+
+body {
+ font-size: 14px;
+}
+input {
+ outline: none;
+}
+
+.login {
+ width: 100%;
+ height: 100vh;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+ .box {
+ ... | Unknown | ๋ง์ฐฌ๊ฐ์ง ์
๋๋ค! font๊ฐ์ ์์ฑ๋ค๋ common.scss์ ์์ฑํด์ ์ ์ญ์ผ๋ก ๊ด๋ฆฌํ ์ ์๊ฒ ์ต๋๋ค! |
@@ -0,0 +1,87 @@
+@import '../../../style/variables.scss';
+@import '../../../style/reset.scss';
+
+
+body {
+ font-size: 14px;
+}
+input {
+ outline: none;
+}
+
+.login {
+ width: 100%;
+ height: 100vh;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+ .box {
+ ... | Unknown | variables.scssํ์ผ์ ์์ผ๋ฉด ๋ ๋ณ์๋ค์ด๋ค์! |
@@ -0,0 +1,163 @@
+import React, { useState, useEffect } from "react";
+import MainFeeds from "./MainFeeds";
+import "./Main.scss";
+import compass from "../assets/icon/compass.png";
+import heart from "../assets/icon/heart.png";
+import instagram from "../assets/icon/instagram.png";
+import search from "../assets/icon... | JavaScript | index.js์์ ์ ์ญ์ผ๋ก importํ๋ค๋ฉด ์ด๋ ๊ฒ ํ์ผ๋ง๋ค ๋งค๋ฒ import ํ์ง์์๋ ๋ฉ๋๋ค! |
@@ -0,0 +1,163 @@
+import React, { useState, useEffect } from "react";
+import MainFeeds from "./MainFeeds";
+import "./Main.scss";
+import compass from "../assets/icon/compass.png";
+import heart from "../assets/icon/heart.png";
+import instagram from "../assets/icon/instagram.png";
+import search from "../assets/icon... | JavaScript | `comment`๋ผ๋ ๋ณ์๋ช
์ด ์์ฑ๋์ด์๋ comment๋ค์ ๋ชจ์์ธ์ง, ๋ด๊ฐ input์ ์
๋ ฅํ ๊ฐ์ ๊ด๋ฆฌํ๋ ๋ณ์์ธ์ง ์ด๋ฆ๋ง ๋ดค์ ๋ ๋ฐ๋ก ์ถ์ธกํ๊ธฐ ์ด๋ ต์ต๋๋ค.
์๋์ commentArray๋ผ๋ ๋ณ์๋ ๋ง์ฐฌ๊ฐ์ง๋ก ์กฐ๊ธ ๋ ๋ณ์๊ฐ ์ด๋ค state๋ฅผ ๊ฐ์ง๊ณ ์๋์ง ๋ช
ํํ ์ด๋ฆ์ผ๋ก ์์ฑํด์ฃผ์๋ฉด ์ข๊ฒ ์ต๋๋ค |
@@ -0,0 +1,163 @@
+import React, { useState, useEffect } from "react";
+import MainFeeds from "./MainFeeds";
+import "./Main.scss";
+import compass from "../assets/icon/compass.png";
+import heart from "../assets/icon/heart.png";
+import instagram from "../assets/icon/instagram.png";
+import search from "../assets/icon... | JavaScript | ```suggestion
setCommentArray(commentList => [ ...commentList,comment]);
```
์ด ๋๊ฐ์ ์ฐจ์ด์ ์ ํ์คํ ์๊ณ ๋์ด๊ฐ์ฃผ์
จ์ผ๋ฉด ์ข๊ฒ ์ต๋๋ค!! |
@@ -0,0 +1,163 @@
+import React, { useState, useEffect } from "react";
+import MainFeeds from "./MainFeeds";
+import "./Main.scss";
+import compass from "../assets/icon/compass.png";
+import heart from "../assets/icon/heart.png";
+import instagram from "../assets/icon/instagram.png";
+import search from "../assets/icon... | JavaScript | Input์ ๊ฐ์ด ๋น์ด์์๋ ํจ์๊ฐ ๊ทธ๋ฅ ์๋ฌด๋ฐ ๋์์ ํ์ง ์๋๋ค๋ฉด ๊ธฐ๋ฅ์ ์๋ฌ์ธ์ง, ์๋๋ ๋์์ธ์ง ํ์
ํ๊ธฐ ์ด๋ ต์ต๋๋ค.
`comment` ๊ฐ์ด ๋น์ด์๋ค๋ฉด ํจ์๊ฐ ํธ์ถ๋ ๋ `alert`๋ฅผ ํ์ํด์ฃผ๋ ๋ฑ์ ์ถ๊ฐ์ ์ธ ์กฐ์น๊ฐ ์์ผ๋ฉด ์ข์ต๋๋ค |
@@ -0,0 +1,163 @@
+import React, { useState, useEffect } from "react";
+import MainFeeds from "./MainFeeds";
+import "./Main.scss";
+import compass from "../assets/icon/compass.png";
+import heart from "../assets/icon/heart.png";
+import instagram from "../assets/icon/instagram.png";
+import search from "../assets/icon... | JavaScript | map ๋ฉ์๋์ ์ฝ๋ฐฑํจ์์ ๋๋ฒ ์งธ ์ธ์, ์ฆ ์งํฌ๋์ ์ฝ๋์์ user๋ผ๊ณ ํ๋ ๋ณ์๋ ๊ธฐ์ค๋ฐฐ์ด(commnetArray)์ value(๋ฐฐ์ด์ ๊ฐ๊ฐ์ ์์)๋ง๋ค์ index(๋ฐฐ์ด๋ด์ ์์)๋ฅผ ๋ํ๋
๋๋ค. ๋ฆฌ์กํธ์์ ๋ฐ๋ณต๋ฌธ์ ์ฌ์ฉํด์ key ์์ฑ์ ๊ผญ ๋ถ์ฌํ๋ผ๊ณ ํ๋ ์ด์ ๋ ํด๋น์์๋ฅผ ๋ฆฌ์กํธ๊ฐ ๋ช
ํ์ด ์ธ์ํ๊ธฐ ์ํจ์ธ๋ฐ, ๋ฐฐ์ด์ index๋ฅผ key๊ฐ์ผ๋ก ๋ถ์ฌํ๋๊ฒ์ ์กฐ๊ธ ์ง์ํ๋ ๋ฐฉ๋ฒ์
๋๋ค. ์ด๋ค ๊ฐ์ผ๋ก key ์์ฑ์ ๋ถ์ฌํด์ผํ ์ง ์กฐ๊ธ ๋ ๊ณ ๋ฏผํด๋ณด์ธ์! |
@@ -0,0 +1,163 @@
+import React, { useState, useEffect } from "react";
+import MainFeeds from "./MainFeeds";
+import "./Main.scss";
+import compass from "../assets/icon/compass.png";
+import heart from "../assets/icon/heart.png";
+import instagram from "../assets/icon/instagram.png";
+import search from "../assets/icon... | JavaScript | ๊ตณ์ด ์ธ๋ถ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ์ง์๋๋ผ๋ `<textarea></textarea>`ํ๊ทธ๋ฅผ ์ฌ์ฉํ๋ฉด multiline input์ ํ์ฉํ ์ ์์ต๋๋ค. |
@@ -0,0 +1,264 @@
+@import '../../../style/reset.scss';
+@import '../../../style/variables.scss';
+
+body {
+ font-size: 14px;
+}
+.logo {
+ font-family: "Lobster";
+ src: url(../assets/Lobster-Regular.ttf);
+}
+input {
+ outline: none;
+}
+
+.navIcon {
+ width: 24px;
+ margin-left: 20px;
+}
+
+.navLeft{
+ .icon... | Unknown | ์์ ๋จ๊ฒจ๋๋ฆฐ ๋ด์ฉ์ ๋ฆฌ๋ทฐ์ ๋์ผํฉ๋๋ค |
@@ -0,0 +1,42 @@
+package racingcar.domain;
+
+import racingcar.exception.CarNameLengthException;
+
+public class Car {
+
+ private static final int CAR_NAME_LENGTH = 5;
+ private static final int MOVABLE_MIN_NUMBER = 4;
+ private final String name;
+ private int position = 0;
+
+ public Car(String name)... | Java | ์ปจ๋ฒค์
์ ๋ฐ๋ผ์ ์์์ ์ธ์คํด์ค ๋ณ์๋ฅผ ์ ์ค๋ก ๊ตฌ๋ถํด์ฃผ์๋ ๊ฒ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค!! |
@@ -0,0 +1,71 @@
+package racingcar.domain;
+
+import racingcar.exception.CarsDuplicatedNameException;
+import racingcar.exception.CarsMaxScoreBlankException;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+public class Cars {
+
+ private static final String DELIMITER = ",";
+ private static final ... | Java | ๋ถ๋ณ ๊ฐ์ฒด๋ฅผ ๋ง๋ค ๋ ์์ฑ์ ๋จ๊ณ์์๋ ๋ฐฉ์ด์ ๋ณต์ฌ๋ฅผ ๊ณ ๋ คํด์ฃผ์๋ฉด ๋ ์ข์ ๊ฒ ๊ฐ์์!!
- [๋ฐฉ์ด์ ๋ณต์ฌ์ Unmodifiable Collections](https://tecoble.techcourse.co.kr/post/2021-04-26-defensive-copy-vs-unmodifiable/) |
@@ -0,0 +1,16 @@
+package racingcar.domain;
+
+import java.util.List;
+
+public class Winner {
+
+ private final List<String> winner;
+
+ public Winner(List<String> winner) {
+ this.winner = winner;
+ }
+
+ public List<String> getWinner() {
+ return winner;
+ }
+} | Java | ๋ฆฌ์คํธ์ ๋ค์ด๋ฐ์ ๋ณต์ํ์ด ๋ ์ ์ ํ๋ค๊ณ ์๊ฐํฉ๋๋ค!
`Winner` ํด๋์ค ์์ฒด๋ ์น๋ฆฌ์๋ค์ ์ด๋ฆ์ ๋ด๊ณ ์๋ ์ผ๊ธ ์ปฌ๋ ์
์ด๊ธฐ ๋๋ฌธ์ `Winners` ๋ผ๋ ๋ค์ด๋ฐ์ ๋ ์ถ์ฒ๋๋ฆฝ๋๋ค! |
@@ -0,0 +1,54 @@
+package racingcar.view;
+
+import racingcar.domain.Car;
+import racingcar.domain.Cars;
+import racingcar.domain.Winner;
+
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public class OutputView {
+
+ private static final String MESSAGE_INPUT_CAR_NAME = "๊ฒฝ์ฃผํ ์๋์ฐจ ์ด๋ฆ์ ์
๋ ฅํ์ธ์.(์ด... | Java | String์์ ์ ๊ณตํ๋ `repeat()` ๋ฉ์๋๋ฅผ ํ์ฉํด๋ณด์๋ ๊ฒ๋ ์ถ์ฒ๋๋ฆฝ๋๋ค! |
@@ -0,0 +1,71 @@
+package racingcar.domain;
+
+import racingcar.exception.CarsDuplicatedNameException;
+import racingcar.exception.CarsMaxScoreBlankException;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+public class Cars {
+
+ private static final String DELIMITER = ",";
+ private static final ... | Java | `CarMoveNumberGenerator` ๋ฅผ `Car` ๊ฐ์ฒด๊น์ง ๋๊ฒจ์ฃผ์ง ์์๋ ๋ ๊ฒ ๊ฐ์ต๋๋ค!
๊ทธ๋ฌ๋ฉด `car.move()` ๋ฉ์๋๋ฅผ ํ
์คํธํ๊ธฐ๋ ํจ์ฌ ๊ฐํธํด์ง ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,22 @@
+package racingcar.domain;
+
+public class RacingCarGame {
+
+ private final Cars cars;
+
+ public RacingCarGame(Cars cars) {
+ this.cars = cars;
+ }
+
+ public void move() {
+ cars.move(new CarRandomMoveNumberGenerator());
+ }
+
+ public Winner findWinner() {
+ r... | Java | `RacingCarGame` ํด๋์ค์ ๋ฉ์๋๋ค์ด ๋๋ถ๋ถ `Cars` ํด๋์ค์ ๋ฉ์๋๋ฅผ ํธ์ถํ๋ ์ฉ๋๋ก๋ง ์ฌ์ฉ๋๋ ๊ฒ ๊ฐ์์!
`RacingCarGame` ํด๋์ค๊ฐ ์ ๋ง ํ์ํ์ง, ์๋๋ฉด ์ด๋ค ์์ผ๋ก `RacingCarGame` ๋ง์ ์๋ก์ด ์ฑ
์์ ๋ถ์ฌํ ์ ์์ ์ง
์๊ฐํด๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์์!! |
@@ -0,0 +1,47 @@
+package racingcar.domain;
+
+import racingcar.exception.TryCommandNumberException;
+import racingcar.exception.TryCommandRangeException;
+
+public class TryCommand {
+
+ private static final int MIN_TRY = 1;
+ private static final int MAX_TRY = 100000;
+ private int tryCount;
+
+ private T... | Java | ๊ฐ ๊ฐ์ฒด์ ๋ด๋ถ ์ํ๋ฅผ `final` ๋ก ์ ์ธํ๋ ๋ฐฉ๋ฒ๋ ์๋๋ผ๊ตฌ์! ์ฐธ๊ณ ํด๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค!
- [Value Object, Reference Obejct](http://aeternum.egloos.com/v/1111257) |
@@ -0,0 +1,71 @@
+package racingcar.domain;
+
+import racingcar.exception.CarsDuplicatedNameException;
+import racingcar.exception.CarsMaxScoreBlankException;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+public class Cars {
+
+ private static final String DELIMITER = ",";
+ private static final ... | Java | ์คํธ๋ฆผ์ผ๋ก ๋ก์ง์ ๋ฐ๊พธ์๋ฉด ๋น ๋ฆฌ์คํธ๋ฅผ ์ ์ธํ์ง ์๊ณ ๋ ๊น๋ํ๊ฒ ๊ตฌํํ ์ ์์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,10 @@
+package racingcar.exception;
+
+public class CarNameLengthException extends IllegalArgumentException{
+
+ private static final String EXCEPTION_MESSAGE_CAR_NAME_LENGTH = "[ERROR] ์๋์ฐจ์ด๋ฆ์ 5๊ธ์ ์ดํ์
๋๋ค";
+
+ public CarNameLengthException() {
+ super(EXCEPTION_MESSAGE_CAR_NAME_LENGTH);
+ }
+} | Java | ํน๋ณํ ์ปค์คํ
์์ธ๋ฅผ ์ฌ์ฉํ์ ์ด์ ๊ฐ ์์๊น์?? ๊ถ๊ธํฉ๋๋ค! |
@@ -0,0 +1,42 @@
+package racingcar.domain;
+
+import racingcar.exception.CarNameLengthException;
+
+public class Car {
+
+ private static final int CAR_NAME_LENGTH = 5;
+ private static final int MOVABLE_MIN_NUMBER = 4;
+ private final String name;
+ private int position = 0;
+
+ public Car(String name)... | Java | ๊ฐ์ฌํฉ๋๋ค! ๋์น๊ณ ์๋ ๋ถ๋ถ์ด๋ค์.. |
@@ -0,0 +1,71 @@
+package racingcar.domain;
+
+import racingcar.exception.CarsDuplicatedNameException;
+import racingcar.exception.CarsMaxScoreBlankException;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+public class Cars {
+
+ private static final String DELIMITER = ",";
+ private static final ... | Java | ์ค... ์ข์๊ธ ๊ฐ์ฌํฉ๋๋ค. ๋ฐฉ์ด์ ๋ณต์ฌ๋ ์ฒ์ ์ ํด๋ณด๋ ๊ฐ๋
์ด๋ค์! |
@@ -0,0 +1,54 @@
+package racingcar.view;
+
+import racingcar.domain.Car;
+import racingcar.domain.Cars;
+import racingcar.domain.Winner;
+
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public class OutputView {
+
+ private static final String MESSAGE_INPUT_CAR_NAME = "๊ฒฝ์ฃผํ ์๋์ฐจ ์ด๋ฆ์ ์
๋ ฅํ์ธ์.(์ด... | Java | ์ด๋ฐ,, ์คํธ๋ฆผ์ ๋๋ฌด ๋จ๋ฐํ๋ค์.. `repeat()` ๋ผ๋ ์ข์ ํจ์๊ฐ ์๋๋ฐ ๋ง์ด์ฃ ใ
|
@@ -0,0 +1,22 @@
+package racingcar.domain;
+
+public class RacingCarGame {
+
+ private final Cars cars;
+
+ public RacingCarGame(Cars cars) {
+ this.cars = cars;
+ }
+
+ public void move() {
+ cars.move(new CarRandomMoveNumberGenerator());
+ }
+
+ public Winner findWinner() {
+ r... | Java | ์๋ `RacingCarGame` ์์ ์๋ํ์๋ฅผ ๊ฐ์ง๊ณ ์์ด์ `Cars` ๋ฅผ ์๋ํ์๋งํผ ์์ง์ด๋ ๋ก์ง์ด์์๋๋ฐ controller ์ชฝ์ผ๋ก ํด๋น ๋ก์ง์ ์ฎ๊ธฐ๋๋ฐ๋์ ์ธ๋ชจ์๋ ํด๋์ค๊ฐ ๋์๋ค์.. ์ข์ ์ง์ ๊ฐ์ฌํฉ๋๋ค..! |
@@ -0,0 +1,47 @@
+package racingcar.domain;
+
+import racingcar.exception.TryCommandNumberException;
+import racingcar.exception.TryCommandRangeException;
+
+public class TryCommand {
+
+ private static final int MIN_TRY = 1;
+ private static final int MAX_TRY = 100000;
+ private int tryCount;
+
+ private T... | Java | ๋ถ๋ณ์ผ๋ก ํด๋ ๊ฐ์ ๋ณ๊ฒฝํ๋ ๋ฐฉ๋ฒ์ด ์์๊ตฐ์..
DDD ์์ ๋์ค๋ ๊ฐ๋
์ด๋ผ MVC ์๋ ์ด๋ป๊ฒ ์ ์ฉํ ์ง๋ ๊ณ ๋ฏผ์ ํด๋ด์ผ๊ฒ ๋ค์..
์ข์๊ธ ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,10 @@
+package racingcar.exception;
+
+public class CarNameLengthException extends IllegalArgumentException{
+
+ private static final String EXCEPTION_MESSAGE_CAR_NAME_LENGTH = "[ERROR] ์๋์ฐจ์ด๋ฆ์ 5๊ธ์ ์ดํ์
๋๋ค";
+
+ public CarNameLengthException() {
+ super(EXCEPTION_MESSAGE_CAR_NAME_LENGTH);
+ }
+} | Java | [์ปค์คํ
์์ธ](https://tecoble.techcourse.co.kr/post/2020-08-17-custom-exception/)
์ปค์คํ
์์ธ๋ค์ ์ฅ๋จ์ ์ด ์์ต๋๋ค! ๊ทธ๋์ ์ ๋ต์ ์์ง๋ง ์ ๊ฐ ์ฌ์ฉํ ์ด์ ๋
์ฒซ์งธ๋กํด๋์ค ์ด๋ฆ์ผ๋ก ์ด๋ค ์์ธ์ธ์ง ๋ฐ๋ก ์ ์ ์๊ณ
๋์งธ๋ก ๋ณดํต ๋๋ฉ์ธ ์ฝ๋๋ฅผ ๋ณผ๋ ์ค์ํ๊ฒ์ ๊ทธ ๋๋ฉ์ธ ์ญํ ๊ณผ ๊ด๋ จ๋ ๋ก์ง์ด์ง, ์์ธ์ฒ๋ฆฌ๋ฅผ ์ด๋ป๊ฒ ํ๋์ง๊ฐ ์ค์ํ๊ฒ ์๋๊ธฐ๋๋ฌธ์ ์์ธ๋ฅผ ๋ฐ๋ก๋นผ๋ด์ด ์ข ๋ ๋ณด๊ธฐ ํธํ๊ฒ ๋ง๋ค๊ธฐ ์ํจ์
๋๋ค!
์
์งธ๋ก ๋๋ถ๋ถ Spring MVC ํ๋ก์ ํธ์์๋ ์ปค์คํ
์์ธ๋ฅผ ์ฌ์ฉํ๊ธฐ์ ์ฐ์ต์ฐจ์์์ ์ปค์คํ
์์ธ๋ฅผ ์ฌ์ฉํ๊ณ ... |
@@ -0,0 +1,32 @@
+package baseball.util
+
+// Message
+const val PRINT_NOTHING_MESSAGE = "๋ซ์ฑ"
+const val PRINT_STRIKE_MESSAGE = "%d์คํธ๋ผ์ดํฌ"
+const val PRINT_BALL_MESSAGE = "%d๋ณผ"
+const val PRINT_STRIKE_BALL_MESSAGE = "%d๋ณผ %d์คํธ๋ผ์ดํฌ"
+const val START_GAME_MASSAGE = "์ซ์ ์ผ๊ตฌ ๊ฒ์์ ์์ํฉ๋๋ค."
+const val QUIT_GAME_MASSAGE = "3๊ฐ์ ์ซ์๋ฅผ ... | Kotlin | util ํด๋๋ฅผ ์ฌ์ฉํด EMPTY_STRING๊ณผ ๊ฐ์ด ์ฌ์ํ ๊ฐ๋ค๊น์ง ์์ํ๋ฅผ ํ์ ๋๋ถ์ ๊ฐ๋
์ฑ์ด ์ข๋ค์. ๋ฐฐ์๊ฐ๋๋ค! |
@@ -0,0 +1,59 @@
+package baseball.game
+
+import baseball.game.service.Game
+import baseball.model.AnswerBoard
+import baseball.model.Computer
+import baseball.util.*
+import baseball.view.User
+import baseball.view.validator.InputValidator
+
+class Baseball(
+ private val user: User,
+ private val computer: Com... | Kotlin | MVC ๋ชจ๋ธ์ ์ฌ์ฉํ์ ๊ฒ ๊ฐ์ต๋๋ค.
Baseball Class๋ Controller์ ์ญํ ์ ํ๋ ๊ฒ ๊ฐ์๋ฐ, Controller์์ ์ง์ ์
๋ ฅ์ ๋ฐ๋ ๊ฒ๋ณด๋ค๋
์ฌ์ฉ์์ ์ง์ ์ ์ผ๋ก ๋ง๋ฟ๋ View์์ ์
๋ ฅ์ ๋ฐ์์ Controller์์ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,12 @@
+package baseball.view
+
+import baseball.util.USER_INPUT_NUMBER_MESSAGE
+import baseball.view.validator.InputValidator
+
+class User {
+ fun createNumber(): String {
+ print(USER_INPUT_NUMBER_MESSAGE)
+ val userNumber = readLine()!!
+ return InputValidator.validateUserNumber(us... | Kotlin | ์ฌ์ฉ์๋ก๋ถํฐ ์
๋ ฅ์ ๋ฐ์์ ๊ฒ์ฌ๋ ๊ฐ์ ๋๋ ค๋ณด๋ด์ฃผ๋ ํจ์์ธ ๊ฒ ๊ฐ์ต๋๋ค.
create๋ผ๋ ํจ์๋ช
์ ๋ณด์์ ๋ ์ ๋ "์ฌ์ฉ์๊ฐ ๋ฒํธ๋ฅผ ๋ง๋๋? ์ฌ์ฉ์๊ฐ ๊ธฐ๊ณ์ ์ญํ ์ ํ๋ ๊ฒ์ธ๊ฐ?"๋ผ๋ ์๊ฐ์ด ๋ค์์ต๋๋ค.
input๊ณผ ์ด์ธ๋ฆฌ๋ ํจ์๋ช
์ด๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.
๋ํ, ์ ๋ ์ด ๋ถ๋ถ์ ์กฐ๊ธ ๊ณ ๋ฏผ๋๋ ๋ถ๋ถ์ด์ง๋ง,
MVC ํจํด์ View์์ ๋ค๋ฅธ ํด๋์ค๋ฅผ ๊ฐ์ ธ์ ๋ถ๊ธฐ๊ฐ ๋ฐ์ํ ์ ์๋ ๋ก์ง์ ์ฌ์ฉํ๋ ๊ฒ์ ํจํด์ ๊ท์น์ ๋ง์ง ์๋๋ค๊ณ ์๊ฐํฉ๋๋ค. |
@@ -0,0 +1,17 @@
+package baseball.view.validator
+
+import baseball.util.*
+
+object InputValidator {
+
+ fun validateUserNumber(userNumber: String): String {
+ require(userNumber.length == MAX_SIZE) { ERROR_INVALID_INPUT_MESSAGE }
+ return userNumber
+ }
+
+ fun validateUserCommand(command: Str... | Kotlin | ๋ฏผ์ฌ๋๊ป์ ์ ์๊ฒ require์ ๋ํด ์๋ ค์ฃผ์
จ์ฃ ..! ์ ์ฐ๊ณ ์์ต๋๋ค! ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,59 @@
+package baseball.model
+
+import baseball.util.*
+
+
+class AnswerBoard {
+ // ์ํ๋ฅผ ๋ชจ๋ ์์์ผ๋ก ์ด๊ธฐํ
+ private val stateList = MutableList(MAX_SIZE) { BaseballState.OUT }
+
+
+ private fun createCount(): Triple<Int, Int, Int> {
+ var strikeCount = 0
+ var ballCount = 0
+ var ou... | Kotlin | createCount๋ผ๋ ํจ์๋ช
์ "๊ฐ์๋ฅผ **_๋ง๋ ๋ค_**"๋ผ๋ ์๋ฏธ์ธ ๊ฒ ๊ฐ์ต๋๋ค.
ํ์ง๋ง ํจ์์ ์ญํ ์ "์คํธ๋ผ์ดํฌ, ๋ณผ, ์์์ ๊ฐ์๋ฅผ **_์ผ๋ค_**"์ธ ๊ฒ ๊ฐ์ต๋๋ค.
ํจ์๋ช
๊ณผ ์ธ๊ฐ์ง์ ๊ธฐ๋ฅ์ ๋๋๋ ๊ฒ์ ์ด๋จ๊น์?
countStrike, countBall, countOut๊ณผ ๊ฐ์ด์! |
@@ -0,0 +1,59 @@
+package baseball.model
+
+import baseball.util.*
+
+
+class AnswerBoard {
+ // ์ํ๋ฅผ ๋ชจ๋ ์์์ผ๋ก ์ด๊ธฐํ
+ private val stateList = MutableList(MAX_SIZE) { BaseballState.OUT }
+
+
+ private fun createCount(): Triple<Int, Int, Int> {
+ var strikeCount = 0
+ var ballCount = 0
+ var ou... | Kotlin | ๋ณ์๋ช
์ด ๋์ฌ + ๋ช
์ฌ๋ก ํ๋ค๋ฉด ํจ์๋ช
๊ณผ ๋ถ์ผ์น ํ์ง ์์๊น์ ?!?
์ด๋ฆ ์ง๊ธฐ์์ ์ค์ํ ๋ช
์ฌ๋ ์์ ์ฐ๋ ๊ฒ์ด ์ข๋ซ๊ณ ํฉ๋๋ค !! ex) countStrike -> strikeCount |
@@ -0,0 +1,12 @@
+package baseball.view
+
+import baseball.util.USER_INPUT_NUMBER_MESSAGE
+import baseball.view.validator.InputValidator
+
+class User {
+ fun createNumber(): String {
+ print(USER_INPUT_NUMBER_MESSAGE)
+ val userNumber = readLine()!!
+ return InputValidator.validateUserNumber(us... | Kotlin | ์ด ๋ถ๋ถ๋ ์ง๊ธ๊น์ง๋ ๊ณ ๋ฏผ์ด์๋๋ฐ ์์ธ์ฒ๋ฆฌ๋ฅผ ๋ฐ๋ก ํด์ฃผ๋ ๊ฒ์ด ์ข๋ค๊ณ ํฉ๋๋ค !! |
@@ -1,37 +1,20 @@
import java.util.List;
+import java.util.Set;
-import domain.LottoGame;
-import domain.LottoResults;
-import domain.WinningAnalyzer;
-import domain.WinningStatistics;
+import domain.ManualRequest;
import view.LottoInputView;
-import view.LottoOutputView;
public class LottoController {
- priv... | Java | ์ผ๊ธ ์ปฌ๋ ์
์ ์จ๋ณด๋ฉด ์ด๋จ๊น์? |
@@ -1,13 +0,0 @@
-import view.LottoInputView;
-
-public class LottoMain {
-
- public static void main(String[] args) {
- int money = LottoInputView.getMoney();
- LottoController lottoController = new LottoController();
- lottoController.playLottoGames(money);
- lottoController.getLottoRes... | Java | - ๊ฐ ๋์
, ๋ฉ์๋ ํธ์ถ๊ณผ ๊ฐ์ด ๊ฐ๋
์ ์ ์ฌ์ฑ์ด ๋ค๋ฅธ ์ฝ๋๋ค๊ฐ์๋ ๊ฐํ์ผ๋ก ๊ฐ๋
์ฑ์ ๋ํ์ค ์ ์์ต๋๋ค.
- ์ปจํธ๋กค๋ฌ์๊ฒ ์ธ๋ถ ๊ธฐ๋ฅ๋ค์ ํธ์ถํ๊ณ ์์ต๋๋ค. ์ด๊ฑด ๋น์ฆ๋์ค๋ก์ง ์ค์ผ์คํธ๋ ์ด์
์ผ๋ก ๋ณด์ฌ์. ๊ทธ๋ฅ ์ ์ ํ Request ๊ฐ์ฒด๋ฅผ ์ ๋ฌํ๊ณ ์ต์ข
๊ฒฐ๊ณผ๋ง ๋ฐํ๋ฐ์์ ์ถ๋ ฅ๊ณ์ธต์๊ฒ ์ ๋ฌํ๋ฉด ๋ ๊ฒ ๊ฐ์์.
- ํ์ฌ ๊ตฌ์กฐ๋ฅผ ๋ณด๋ฉด LottoMain์ด ์ปจํธ๋กค๋ฌ์ ์ญํ ์ ํ๊ณ ์๊ณ , LottoController๊ฐ Service Layer์ ์ญํ ์ ํ๊ณ ์์ต๋๋ค. ๊ทธ๋ผ ์ฐจ๋ผ๋ฆฌ Controller์์ View Layer๋ฅผ ๋ถ๋ฆฌํด LottoMain์ผ๋ก ์ฎ๊ธฐ์๊ณ LottoCo... |
@@ -0,0 +1,15 @@
+package domain;
+
+public class GameCount {
+ private final int manualCount;
+ private final int automaticCount;
+
+ public GameCount(int totalCount, int manualCount) {
+ this.manualCount = manualCount;
+ this.automaticCount = totalCount - manualCount;
+ }
+
+ public int g... | Java | ๋ด๋ถ์ ์ผ๋ก ๊ฐ์ด ๋ณ๊ฒฝ๋์ง ์๋๋ค๋ฉด final ํค์๋๋ฅผ ํตํด ๋ถ๋ณ์ฑ ํ๋ณด๋ฅผ ํ ์ ์์ ๊ฒ ๊ฐ๋ค์. |
@@ -1,23 +1,47 @@
package domain;
+import java.util.List;
+import java.util.Set;
+
public class LottoGame {
private LottoResults lottoResults;
-
private Money money;
+ private WinningAnalyzer winningAnalyzer;
public LottoGame() {
this.lottoResults = new LottoResults();
}
- pub... | Java | ์ด๋ฐ ์ฐธ์กฐํ์
๋ ์ผ๊ธ ์ปฌ๋ ์
์ ์ด์ฉํด์ ๋ด๋ถ ์ธ๋ฑ์ค ์ ์ด๋ฅผ ์ฑ
์ ๋ถ๋ฆฌํ ์ ์์ ๊ฒ ๊ฐ์์. |
@@ -1,23 +1,47 @@
package domain;
+import java.util.List;
+import java.util.Set;
+
public class LottoGame {
private LottoResults lottoResults;
-
private Money money;
+ private WinningAnalyzer winningAnalyzer;
public LottoGame() {
this.lottoResults = new LottoResults();
}
- pub... | Java | Money๊ฐ์ฒด์ธ๋ฐ count์ ๋ณด๊น์ง ๋ด์๋ฒ๋ฆฌ๋ฉด ์ผ๊ธ ๊ฐ์ฒด๋ก์จ์ ํจ์ฉ์ด ๋จ์ด์ง๊ณ ๊ฐ์ฒด ์๊ทธ๋์ฒ๊ฐ ๋ถ๋ถ๋ช
ํด์ง ๊ฒ ๊ฐ๋ค์ ๐ค |
@@ -1,23 +1,47 @@
package domain;
+import java.util.List;
+import java.util.Set;
+
public class LottoGame {
private LottoResults lottoResults;
-
private Money money;
+ private WinningAnalyzer winningAnalyzer;
public LottoGame() {
this.lottoResults = new LottoResults();
}
- pub... | Java | ์๋,์๋ ๋ก๋๋ฉด ๊ทธ๋ฅ LottoNumber, Lotto, Lottos ์ ๋๋ก ๋ค์ด๋ฐ์ ์ง์ด๋ ๋ ๊ฒ ๊ฐ๋ค์ Result๋ผ๊ณ ํ๋ ๋ญ๊ฐ ๋น๊ต๊น์ง ๋ค ๋๋ ์ต์ข
๊ฒฐ๊ณผ๋ฅผ ์๋ฏธํ๋ ๊ฑธ๋ก ๋ณด์
๋๋ค. |
@@ -1,23 +1,47 @@
package domain;
+import java.util.List;
+import java.util.Set;
+
public class LottoGame {
private LottoResults lottoResults;
-
private Money money;
+ private WinningAnalyzer winningAnalyzer;
public LottoGame() {
this.lottoResults = new LottoResults();
}
- pub... | Java | ์๋์์ฑ๊ณผ ์๋์์ฑ์ ๋ฉ์๋๋ก ๊ตฌ๋ถํ๊ณ ์๋๋ฐ LottoGenerator -> LottoAutoGenerator, LottoManualGenerator ๋ฑ์ผ๋ก ์ ๋ตํจํด์ ์ฌ์ฉํ ์๋ ์์ ๊ฒ ๊ฐ๋ค์ |
@@ -1,23 +1,47 @@
package domain;
+import java.util.List;
+import java.util.Set;
+
public class LottoGame {
private LottoResults lottoResults;
-
private Money money;
+ private WinningAnalyzer winningAnalyzer;
public LottoGame() {
this.lottoResults = new LottoResults();
}
- pub... | Java | ์ด ๋ฉ์๋๋ ProfitCalculator -> DefaultProfiltCalculator๋ฑ์ผ๋ก ๋ถ๋ฆฌํด์ ์ด์จ ๊ณ์ฐ๋ ์ถ์ํํ๋ฉด ์ ์ง๋ณด์์ฑ์ด ๋์์ง ๊ฒ ๊ฐ์์ |
@@ -1,7 +1,9 @@
package domain;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
+import java.util.Set;
public class LottoResult {
private List<LottoNumber> lottoResult;
@@ -14,10 +16,11 @@ public LottoResult(List<LottoNumber> lottoNumbers) {
this.lottoResult = lottoN... | Java | ๋๋ค์์์ count๋ผ๋ ์ธ๋ถ ๊ฐ์ ์ํฅ์ ์ฃผ๊ณ ์์ด์. ๐ค
๋๋ค์์ ์ธ๋ถ๊ฐ์ ๋ํ ์ํฅ์ ์ฃผ์ง ์์์ผ ํ๊ธฐ์ ์์ ํจ์๋ก ์ค๊ณ๋์ผํฉ๋๋ค. ๋ก์ง๋ด์์ ์ง์ count๊ฐ์ ์ง์ญ๋ณ์๋ฅผ ๋ณ๊ฒฝํ๋ ค๊ณ ํ๋ฉด effective final variable์ ์์ ํ๋ คํ๋ค๊ณ ์ปดํ์ผ ์๋ฌ๊ฐ ๋ฐ์ํ ๊ฒ์ธ๋ฐ, ๋ฉ์๋๋ฅผ ๋ค์ ํธ์ถํด์ ๊ทธ ๋ฌธ์ ๋ฅผ ํผํ์ง๋ง, ๊ทธ๋ ๋ค๊ณ ๋ฌธ์ ๊ฐ ๋์ง ์๋๊ฑด ์๋๋๋ค.
filter์ count๋ฑ์ ์ด์ฉํด์๊ตฌํํ ์๋ ์์ ๊ฒ ๊ฐ๋ค์ |
@@ -1,68 +1,75 @@
package domain;
+import static domain.WinningStatistics.THRESHOLD;
+
import java.util.HashMap;
import java.util.Map;
+import java.util.function.Function;
public enum WinningPrizes {
- MISS(0, 0) {
-
- },
- FIFTH_PRIZE(5, 5_000),
- FOURTH_PRIZE(4, 50_000),
- THIRD_PRIZE(3, 1_500_... | Java | IntFunction์ ํ์ฉํด๋ ์ข์ ๊ฒ ๊ฐ์์. |
@@ -2,25 +2,62 @@
import static org.assertj.core.api.Assertions.assertThat;
+import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.junit.jupiter.api.Test;
public class LottoGameTest {
@Test
- public void ๋ก๋_๊ตฌ์
๊ธ์ก์_์
๋ ฅํ๋ฉด_๊ตฌ์
๊ธ์ก์_ํด๋นํ๋_๋ก๋๋ฅผ_๋ฐํํ๋ค() ... | Java | ์ฌ์ฉํ์ง ์๋ ์ฃผ์(์ฝ๋)์ ์ ๊ฑฐํด์ฃผ์ธ์! |
@@ -0,0 +1,97 @@
+package com.selab.todo.controller;
+
+import com.selab.todo.common.dto.PageDto;
+import com.selab.todo.common.dto.ResponseDto;
+import com.selab.todo.dto.request.diary.DiaryRegisterRequest;
+import com.selab.todo.dto.request.diary.DiaryUpdateRequest;
+import com.selab.todo.dto.request.feel.FeelingUpda... | Java | ์ด๋ฐ ๊ฒฝ์ฐ์๋ month๋ฅผ Request Param์ผ๋ก |
@@ -0,0 +1,97 @@
+package com.selab.todo.controller;
+
+import com.selab.todo.common.dto.PageDto;
+import com.selab.todo.common.dto.ResponseDto;
+import com.selab.todo.dto.request.diary.DiaryRegisterRequest;
+import com.selab.todo.dto.request.diary.DiaryUpdateRequest;
+import com.selab.todo.dto.request.feel.FeelingUpda... | Java | ์ ์ฌ๋ฌ ์กฐ๊ฑด์ผ๋ก ๊ฒ์ ๊ธฐ๋ฅ์ ๋ง๋์ ๊ฒ ๊ฐ์๋ฐ, API๋ฅผ ๋๋์ง ๋ง๊ณ , ๊ฒ์ ๋ชจ๋์ ๋ง๋๋๊ฒ ์ด๋จ๊น์? |
@@ -0,0 +1,71 @@
+package com.selab.todo.entity;
+
+import com.selab.todo.common.BaseEntity;
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import org.springframework.data.annotation.CreatedDate;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.p... | Java | enumrated ์ถ๊ฐํด์ผ ๋ ๊ฒ ๊ฐ์๋ฐ์? |
@@ -0,0 +1,97 @@
+package com.selab.todo.controller;
+
+import com.selab.todo.common.dto.PageDto;
+import com.selab.todo.common.dto.ResponseDto;
+import com.selab.todo.dto.request.diary.DiaryRegisterRequest;
+import com.selab.todo.dto.request.diary.DiaryUpdateRequest;
+import com.selab.todo.dto.request.feel.FeelingUpda... | Java | url path์ ๋ํด ๋ค์ ํ๋ฒ ๋ ์ ๊ฒ ๋ถํ๋๋ฆ
๋๋ค!
rest url ๊ท์น ํ์ธํ๊ธฐ |
@@ -0,0 +1,71 @@
+package com.selab.todo.entity;
+
+import com.selab.todo.common.BaseEntity;
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import org.springframework.data.annotation.CreatedDate;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.p... | Java | LocalDateTime ํน์ ZoneDateTime๊ณผ ๊ฐ์ ์๊ฐ์ ๋ค๋ฃจ๋ ๊ฐ์ฒด ์ฌ์ฉ์ ํ์ง ์์ ์ด์ ๊ฐ ๋ฌด์์ผ๊น์? |
@@ -0,0 +1,23 @@
+package com.selab.todo.entity;
+
+import lombok.AccessLevel;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.*;
+
+@Entity(name = "feeling")
+@Getter
+@Table(name = "feeling")
+@NoArgsConstructor(access = AccessLevel.PROTECTED)
+@... | Java | ํด๋น ํด๋์ค์ ์ญํ ์ ๋ฌด์์ผ๊น์?
id, baseentity ์ ๋๋ ์ถ๊ฐํด๋ ๋ ๊ฒ ๊ฐ์์ |
@@ -0,0 +1,97 @@
+package com.selab.todo.controller;
+
+import com.selab.todo.common.dto.PageDto;
+import com.selab.todo.common.dto.ResponseDto;
+import com.selab.todo.dto.request.diary.DiaryRegisterRequest;
+import com.selab.todo.dto.request.diary.DiaryUpdateRequest;
+import com.selab.todo.dto.request.feel.FeelingUpda... | Java | ์ ์ฉํด๋ณด์์ต๋๋ค |
@@ -0,0 +1,97 @@
+package com.selab.todo.controller;
+
+import com.selab.todo.common.dto.PageDto;
+import com.selab.todo.common.dto.ResponseDto;
+import com.selab.todo.dto.request.diary.DiaryRegisterRequest;
+import com.selab.todo.dto.request.diary.DiaryUpdateRequest;
+import com.selab.todo.dto.request.feel.FeelingUpda... | Java | default๋ ์ ํ์ํด์?? |
@@ -0,0 +1,97 @@
+package com.selab.todo.controller;
+
+import com.selab.todo.common.dto.PageDto;
+import com.selab.todo.common.dto.ResponseDto;
+import com.selab.todo.dto.request.diary.DiaryRegisterRequest;
+import com.selab.todo.dto.request.diary.DiaryUpdateRequest;
+import com.selab.todo.dto.request.feel.FeelingUpda... | Java | REST API
- POST : /api/v1/diaries
- GET : /api/v1/diaries
- GET : /api/v1/diaries/{id}
- PUT : /api/v1/diaries/{id}
- DELETE : /api/v1/diaries/{id}
์ด ํํ ์๋๊ฐ์?
๊ทธ๋ฆฌ๊ณ url path์ ์ ๋๋ฌธ์๊ฐ ๋ค์ด๊ฐ๋๊ฑธ๊น์ฉ? |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | ์๋ก ์ฑ๊ฒฉ์ด ๋ค๋ฅธ ๋ณ์ ์ ์ธ ๊ฐ์๋ ์ค๋ฐ๊ฟ์ ํ ๋ฒ ๋ฃ์ด์ฃผ๋ ๊ฒ ๋ ๋ณด๊ธฐ ์ข์ง ์์๊น์??๐ค |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | ์กฐ๊ฑด๋ฌธ์ ์ซ์์ ๋งค๊ฐ๋ณ์๊ฐ ์ผ์นํ๋ค์!
์ด๋ฐ ์์ผ๋ก ์ฝ๋๋ฅผ ์ค์ผ ์ ์์ง ์์๊น์??๐
```suggestion
answer = randomNumber(numberOfDigit[0]);
``` |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | JS์์ ์ ๊ณตํ๋ ํจ์๋ฅผ ์ ํ์ฉํ์
จ๋ค์! ๐ |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | ๋งค์ง ๋๋ฒ ๋ถ๋ฆฌ์ ๋ค์ด๋ฐ ์ปจ๋ฒค์
์ ์ค์ํ์
จ๋ค์! ๐ |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | ํ๋์ ํจ์๋ ํ ๊ฐ์ง ์ฑ
์๋ง ๊ฐ๋๋ก ํ๋ ๊ฒ ์ข์์!
randomNumber ํจ์์์๋ ์ค๋ณต๋์ง ์๋ ๋์๋ฅผ ๋ฐํํ๋ ๊ฒ์ด ๋ชฉํ์ธ๋ฐ, randomNumber ๋ณ์์ ๋๋ค๊ฐ์ ๋ฃ๋ ํ์๋ ๊ทธ ์ฑ
์๊ณผ๋ ๋ถ๋ฆฌํ ์ ์์ ๊ฒ ๊ฐ์์.
`let randomNumber = Math.floor(Math.random() * (MAX_RANDOM_NUMBER - MIN_RANDOM_NUMBER) + MIN_RANDOM_NUMBER);` ๋ฅผ ๋ค๋ฅธ ํจ์๋ก ๋ถ๋ฆฌํด๋ณด๋ ๊ฑด ์ด๋จ๊น์?? ๐
[์ฐธ๊ณ ์๋ฃ](https://inpa.tistory.com/entry/OOP-%F0%... |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | while๋ฌธ ํธ์ถ ์ด์ ์ randomNumber์ ์ ์๋ฏธํ ๊ฐ์ ๋ฃ๊ธฐ ์ํด์ ๋๋ค๊ฐ์ ์์ฑํ์ฌ ๋ฏธ๋ฆฌ ๋ฃ์ด์ฃผ๊ณ while์ ํธ์ถํ ๊ฒ ๊ฐ๋ค์. ํ์ง๋ง ์ด๋ ๊ฒ ๋๋ฉด randomNumber์ ์ด๊ธฐํ์์ ๋ํด์ ์ฝ๋ ์ค๋ณต์ด ์ผ์ด๋๊ฒ ๋ฉ๋๋ค!
do .. while ๋ฌธ์ ์ฌ์ฉํด์ ์ฝ๋ ์ค๋ณต์ ์์จ ์ ์์ง ์์๊น์?? ๐ |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | newRow๋ HTML ์์์ธ ๊ฒ ๊ฐ์๋ฐ $๋ฅผ ๋ถ์ฌ์ฃผ๋๊ฒ ๋ง์ง ์์๊น์?? ๐ค
์ ๋ ์ด๋ถ๋ถ์ ํ์คํ์ง ์์ผ๋ ์ง์ ๊ณ ๋ฏผํด๋ณด์๋ ๊ฒ ์ข์ ๊ฒ ๊ฐ์์!
[์ฐธ๊ณ ์๋ฃ](https://choseongho93.tistory.com/213) |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | ์ด ๋ถ๋ถ๋ค๋ HTML ์์์ธ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | ์ฝ๋์ ๊ฐ๊ฒฐํจ์ ์ํด ์ข์ ๋ฐฉ๋ฒ์ด ๋ ์๋ ์์ง๋ง, ํ ํ์์๋ ํ๋์ ๋ณ๊ฒฝ๋ง์ด ์ผ์ด๋์ผ ํ๋ค๋ ๋ง์ ๋ค์ ์ ์ด ์๋ ๊ฒ ๊ฐ์์!
 |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | ๊ฒฝ๊ณ ๋ฌธ์ ๋ด์ฉ์ด ๊ฒน์น๋๋ฐ, ๊ฒฝ๊ณ ๋ฌธ์ ํจ์๋ก ๋ถ๋ฆฌํ๊ฑฐ๋ ๊ฒฝ๊ณ ๋ฌธ ๋ด์ฉ์ ๋ฌธ์์ด ๋ฆฌํฐ๋ด๋ก ์ ์ํ๋ ๊ฑด ์ด๋จ๊น์? ๐ |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | ๋ณ๊ฒฝํ innerText ๋ด์ฉ์ ๋ณ์๋ฅผ ๊ฐ๋ ๋ฌธ์์ด ๋ฆฌํฐ๋ด๋ก ํํํ ์ ์์ง ์์๊น์?? ๐
[์ฐธ๊ณ ์๋ฃ](https://www.delftstack.com/ko/howto/javascript/javascript-variable-in-string/) |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | ```
score[0] -> ball
score[1] -> strike
```
์ธ ๊ฒ ๊ฐ์๋ฐ, ์ด๋ ๊ฒ ๋งค์ง ๋๋ฒ๋ฅผ ํตํด ์์ฑํ๊ฒ ๋๋ฉด ๋ค๋ฅธ ์ฌ๋๋ค์ด ์ฝ๋๋ฅผ ๋ณด์์ ๋ ์ธ๋ฑ์ค ๋ณ ์ญํ ์ ๋ํด ํด์ํ๊ธฐ ํ๋ค ๊ฒ ๊ฐ์์! ์ธ๋ฑ์ค์ธ 0๊ณผ 1์ ๊ฐ๊ฐ ์์๋ก ๋ถ๋ฆฌํด๋ณด๋ ๊ฑด ์ด๋จ๊น์? ๐ |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | 
๊นํ๋ธ์์ `No newline at end of file`๋ผ๋ ์๋ฌ๊ฐ ๋ํ๋๋ค์! ์ด๋ฐ ์๋ฌ๋ ์ ๋ํ๋๋ ๊ฑธ๊น์??
[์ฐธ๊ณ ์๋ฃ](https://velog.io/@jesop/%EC%9E%90%EB%B0%94%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8-%EC%BD%94%EB%93%9C-%EB%A7%88%EC%A7%80%EB%A7%89%EC%9... |
@@ -0,0 +1,29 @@
+.container{
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ min-height: 100vh;
+}
+
+.btn-group, .input-content, .table-content{
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ margin: 10px;
+}
+
+table{
+ ... | Unknown | ์ค ์ด๋ฐ ๋ฐฉ๋ฒ๋ ์๊ตฐ์...!! ๐ฎ |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | ๋ต ๊ฐ์ฌํฉ๋๋ค!
๋ฆ๊ฒ ๋ฆฌ๋ทฐ๋ฌ์์ ์ ๋ง ์ฃ์กํฉ๋๋ค... |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | ์ํ ์๊ฒ ์ต๋๋ค! |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | ์ฐธ๊ณ ์๋ฃ ์ ์ฝ์ด๋ดค์ต๋๋ค! SRP์ ๋ํด ์ข ๋ ๊ณต๋ถ๊ฐ ํ์ํ ๊ฒ ๊ฐ๋ค์. ์ฐธ๊ณ ์๋ฃ๋ฅผ ์ฝ์ผ๋ฉด์ ์ข ํท๊ฐ๋ ธ๋ ๋ถ๋ถ์ด ์๋๋ฐ "์์ง๋๋ฅผ ๋๊ฒ, ๊ฒฐํฉ๋๋ ๋ฎ๊ฒ" ๋ผ๋ ๋ฌธ์ฅ์์ ์์ง๋์ ๊ฒฐํฉ๋์ ์ฐจ์ด์ ๋ํด ์กฐ๊ธ ํท๊ฐ๋ฆฝ๋๋ค. ์์ง๋๋ ํจ์ ์์ ๊ตฌ์ฑ์์๋ค์ ์ฐ๊ด๋ ์ ๋, ๊ฒฐํฉ๋๋ ์๋ก ๋ค๋ฅธ ํจ์๊ฐ์ ์ฐ๊ด๋ ์ ๋๋ก ํด์ํ๋๋ฐ ์ด๊ฒ ๋ง๋ ํด์์ธ์ง ์๊ณ ์ถ์ต๋๋ค. |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | function getRandomNumber()๋ก ์๋ก์ด ํจ์๋ฅผ ๋ง๋ค์ด์ ์ค๋ณต์ ํผํ๋๋ก ์์ ํ๊ฒ ์ต๋๋ค! |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | ์ฃผ๋ก ๋ง์ ์ฌ๋๋ค์ด ์ฌ์ฉํ๋ ํจ์๋ฅผ ์ฌ์ฉํด์ผ ํ๋์ง ์๋๋ฉด ์ ๊ฐ ํ์๋ก ํ๋ ํจ์๋ฅผ ์จ์ผ ํ๋๊ฐ ๊ถ๊ธํฉ๋๋ค!
์๋ฅผ ๋ค์ด existingNumber๋ ๋ฐฐ์ด์ด๊ธฐ ๋๋ฌธ์ includesํจ์๋ฅผ ์ฌ์ฉํด์ randomNumber๊ฐ ํฌํจ๋์ด ์๋์ง ์ฐพ์๋๋ฐ, ๋ง์ฝ ์ด ํจ์๋ฅผ ๋ค๋ฅธ ์ฌ๋๋ค์ด ์์ฃผ ์ฌ์ฉํ์ง ์๋๋ค๋ฉด ๋ค๋ฅธ ๋ฐฉ๋ฒ์ ์ฐพ์์ ํ๋ก๊ทธ๋๋ฐ ํด์ผ ํ๋์ง ๋ฌป๊ณ ์ถ์ต๋๋ค. |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | do .. while ๋ฌธ์ ์ฌ์ฉํด์ ์ค๋ณต ์์ ๋ณด๊ฒ ์ต๋๋ค!! do .. while ๋ฌธ์ ์๊ฐ ๋ชปํ๋ค์.. |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | $๋ฅผ ๋ถ์ด๋ ๊ฒ์ด ๋ง๋ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,96 @@
+const MAX_RANDOM_NUMBER = 9;
+const MIN_RANDOM_NUMBER = 1;
+const $inputNumber = document.querySelector('.input-number');
+const $gameTable = document.querySelector(".game-table");
+
+let answer;
+
+function inputDigit(numberOfDigit){
+ $gameTable.innerHTML = "<tr><td>์์</td><td>์ซ์</td><td>๊ฒฐ๊ณผ</td><... | JavaScript | ๊ทธ๋ฌ๋ฉด index๊ฐ์ turn์ ๋ฃ๋ ๊ฒ, index๊ฐ 1์ฉ ์ฆ๊ฐ ํ๋ ๊ฒ ๋ ๊ฐ๋ฅผ ๋๋๋๋ก ์์ ํ๊ฒ ์ต๋๋ค! |
@@ -0,0 +1,40 @@
+// Controller๋ ์ค์ง Service ๋ ์ด์ด์๋ง ์์กดํฉ๋๋ค.
+const { userService } = require('../services');
+const { errorGenerator } = require('../erros');
+
+const signUp = async (req, res, next) => {
+ try {
+ const {
+ email,
+ hashedPassword,
+ phoneNumber,
+ profileImageUrl,
+ introduct... | JavaScript | ๋ณ์ ์ ์ธํ ๋๋ `scope` ๊ด๋ฆฌ๋ฅผ ์ํด์ ํญ์ `const`, `let` ๋ฑ์ ํค์๋๋ฅผ ์ฌ์ฉํด์ฃผ๋๊ฒ ์ข์ต๋๋ค! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.