-
Notifications
You must be signed in to change notification settings - Fork 166
[๐ ์ฌ์ดํด1 - ๋ฏธ์ (๋ณด๋ ์ด๊ธฐํ + ๊ธฐ๋ฌผ ์ด๋)] ์ดํ ๋ฏธ์ ์ ์ถํฉ๋๋ค. #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
31156ca
docs: 1๋จ๊ณ ๋ณด๋์ด๊ธฐํ ๋ฌธ์ ์์ฑ
jihwankim128 479c1d2
feat: ํ/์ด ์์ฐจ๋ฆผ ์
๋ ฅ ๊ธฐ๋ฅ ์ถ๊ฐ
Sauter001 d48f485
feat: ์์ฐจ๋ฆผ ๊ฒฐ๊ณผ ์ถ๋ ฅ ๊ธฐ๋ฅ ์ถ๊ฐ
jihwankim128 e3deb3e
docs: 2๋จ๊ณ ๊ธฐ๋ฌผ ์ด๋ ๊ธฐ๋ฅ ๋ช
์ธ
Sauter001 43b6a34
feat: ๊ธฐ๋ฌผ ์ด๋ ๊ธฐ๋ฅ ์ถ๊ฐ
jihwankim128 4aa1071
์ฐจ/์/๋ง์ ๋ํ ๋ฉฑ ๊ธฐ์ค ์ ์ฉ
Sauter001 c0b0c98
refactor: ๊ธฐ๋ฌผ์ ์ง์ ํ๋จ ๋ก์ง ๋ฉ์๋๋ก ๋ถ๋ฆฌ(isCho)
Sauter001 6dc5899
feat: ํฌ ์ด๋ ๊ท์น ์ถ๊ฐ
Sauter001 f389157
refactor: ์ฌ์ฉํ์ง ์๋ import ์ ๊ฑฐ ๋ฐ ๋ฉ์๋ ์์ step-down ๋ฐฉ์ ์ ์ฉ
Sauter001 a994b25
style: ์ฃผ์ javadocs๋ก ๋ณ๊ฒฝ
Sauter001 8a9035d
refactor: import.* ํด์
Sauter001 ca929e7
refactor: ์, ๋ง๊ฐ ๋ฉฑ์ผ ๋ ํ
์คํธ ์ฝ๋ ์ถ๊ฐ
Sauter001 e980fe6
refactor: ๋ฉ์๋ ์์ ์์
jihwankim128 ebba9f4
refactor: ์ฅ๊ธฐํ ๋ก์ง ์ค๊ดํธ Depth ๊ฐ์ํ๋ ๋ก์ง์ผ๋ก ์์
jihwankim128 c26b932
refactor: ์ฃผ์ ์ ๊ฑฐ
jihwankim128 7015c8b
test: ์ฐจ์ ํฌ ๊ธฐ๋ฌผ ์ด๋ test fixture ๋ฐ์ดํฐ ์
์์
jihwankim128 d6a8dd6
test: ํ
์คํธ ์ค๋ณต ์ ๊ฑฐ ๋ฐ ์ฌ๋ฐ๋ฅธ ๊ฐ์ฒด ํ
์คํธ๋ก ์ด๋
jihwankim128 7fba746
refactor: ๊ธฐ๋ฌผ ์ด๋ ๊ฒฝ๋ก ํ
์คํธ ๋ฆฌํฉํ ๋ง
jihwankim128 6e7083e
refactor: ๋ณด๋ ์ผ๊ธ ์ปฌ๋ ์
๊ณผ ์ฅ๊ธฐ AggregateRoot ๋ช
ํํ ๋ถ๋ฆฌ
jihwankim128 b44e3fd
refactor: ์ฅ๊ธฐํ ๊ด๋ จ ํด๋์ค ํจํค์ง ๋ถ๋ฆฌ
jihwankim128 ba78637
refactor: board move ๋ก์ง ๋ฆฌํฉํ ๋ง
jihwankim128 cb70ddc
refactor: ์ฅ๊ธฐ ํฌ๋ฉ์ด์
๋ก์ง ๋ฆฌํฉํ ๋ง
jihwankim128 528918a
refactor: ๊ธฐ๋ฌผ ์ ํ ๋ฐ ๋ฐฐ์น์ ๋ํ ์
๋ ฅ ๋ฉ์๋ ๋ค์ด๋ฐ ์์
jihwankim128 b743a35
refactor: ๋ณด๋ ๋ฐ ์ฅ๊ธฐ๊ฒ์ ์ถ์ํ ์์ค ํต์ผ
jihwankim128 a531224
refactor: ๊ธฐ๋ฌผ ๋ณ ์ด๋ ์ค๋ณต ๋ก์ง ๋ถ๋ฆฌ
jihwankim128 f20b496
refactor: ๊ธฐ๋ฌผ ์ด๋ ๊ฒ์ฆ ๋ก์ง ๊ฐ์
jihwankim128 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,186 @@ | ||
| # java-janggi | ||
| # 1๋จ๊ณ - ๋ณด๋ ์ด๊ธฐํ | ||
|
|
||
| ์ฅ๊ธฐ ๋ฏธ์ ์ ์ฅ์ | ||
| ``` | ||
| ํ๋๋ผ์ ์์ฐจ๋ฆผ์ ์ ํํด์ฃผ์ธ์. | ||
| 1. ์๋ง์๋ง | ||
| 2. ๋ง์๋ง์ | ||
| 3. ๋ง์์๋ง | ||
| 4. ์๋ง๋ง์ | ||
|
|
||
| 3 | ||
|
|
||
| ์ด๋๋ผ์ ์์ฐจ๋ฆผ์ ์ ํํด์ฃผ์ธ์. | ||
| 1. ์๋ง์๋ง | ||
| 2. ๋ง์๋ง์ | ||
| 3. ๋ง์์๋ง | ||
| 4. ์๋ง๋ง์ | ||
|
|
||
| 5 | ||
| [ERROR] ์ ํจํ์ง ์์ ์์ฐจ๋ฆผ ๋ฒํธ์ ๋๋ค. | ||
|
|
||
| 3 | ||
|
|
||
| ใใใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผ | ||
| ใ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ | ||
| ๏ผ๏ฝใ่ปใ้ฆฌใ่ฑกใๅฃซใ๏ผใๅฃซใ่ฑกใ้ฆฌใ่ปใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใ๏ผใ๏ผใ๏ผใๆผขใ๏ผใ๏ผใ๏ผใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใๅ ใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใๅ ใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใๅ ตใ๏ผใๅ ตใ๏ผใๅ ตใ๏ผใๅ ตใ๏ผใๅ ตใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใๅใ๏ผใๅใ๏ผใๅใ๏ผใๅใ๏ผใๅใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใๅ ใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใๅ ใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใ๏ผใ๏ผใ๏ผใๆฅใ๏ผใ๏ผใ๏ผใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ่ปใ้ฆฌใ่ฑกใๅฃซใ๏ผใๅฃซใ่ฑกใ้ฆฌใ่ปใ๏ฝ | ||
| ใ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ | ||
| ``` | ||
|
|
||
| ## ๊ธฐ๋ฅ ์ ๋ฆฌ | ||
|
|
||
| - ์์ฐจ๋ฆผ ์์ ๊ด๋ฆฌ | ||
| - ํ๋๋ผ๋ถํฐ ์์ฐจ๋ฆผ ์ ๋ ฅ์ ๋ฐ๋๋ค. | ||
| - ๋ค์์ผ๋ก ์ด๋๋ผ ์์ฐจ๋ฆผ ์ ๋ ฅ์ ๋ฐ๋๋ค. | ||
| - ์๋ชป๋ ์ ๋ ฅ์ ์์ธ | ||
| - ์์ฐจ๋ฆผ ๋ณ ์ํ ๊ด๋ฆฌ | ||
| - ์๋ง์๋ง | ||
| - ๋ง์๋ง์ | ||
| - ๋ง์์๋ง | ||
| - ์๋ง๋ง์ | ||
| - ์ด๊ธฐ ๋ฐฐ์น๋ฅผ ์ํ ๋ณด๋ ์ ๋ณด | ||
| - ์์น | ||
| - ๊ฒฉ์ ๋ฒ์ | ||
| - ๋ฐฐ์น๋ ์ฅ๊ธฐ๋ง | ||
| - ์ฅ๊ธฐ๋ง ์ ๋ณด | ||
| - ์ฐจ, ๋ง, ์, ์ฌ, ์กธ(๋ณ), ํฌ, ์ฅ | ||
| - ์์ ์ ๋๋ผ ์ ๋ณด | ||
| - ๋๋ผ ์ ๋ณด | ||
| - ํ, ์ด | ||
|
|
||
| ## ๊ตฌํ ์์ | ||
|
|
||
| * ์ด๋๋ผ/ํ๋๋ผ ์์ฐจ๋ฆผ ์ ๋ ฅ | ||
| * ๋๋ผ ๋ณ ์ ํจํ ์์ฐจ๋ฆผ์ ์ ๋ ฅ๋ฐ๋๋ค. | ||
| * ์์ฐจ๋ฆผ์ ๋ฐ๋ฅธ ์ฅ๊ธฐํ ์ด๊ธฐ ๋ฐฐ์น | ||
| * ์ฅ๊ธฐํ์ ์์นํ ์ฅ๊ธฐ๋ง์ด ํ์ํ๋ค. | ||
| * ์ฐจ, ์, ๋ง, ํฌ, ์กธ, ์ฌ, ์ฅ | ||
| * ์ด๋ฆ | ||
| ์ ๋ณด: [๋๋ฌด์ํค](https://namu.wiki/w/%EC%9E%A5%EA%B8%B0/%EA%B8%B0%EB%AC%BC%20%EB%B0%8F%20%ED%96%89%EB%A7%88%EB%B2%95) | ||
| ์ฐธ์กฐ | ||
| * ์ฅ๊ธฐ๋ง์ด ์์นํ ์์น ์ ๋ณด๊ฐ ํ์ํ๋ค. | ||
| * ์ฅ๊ธฐํ ์์น ๋ฒ์๋ฅผ ์ด๊ณผํ๋ฉด ์์ธ๊ฐ ๋ฐ์ํด์ผํ๋ค. | ||
| * ์ฅ๊ธฐํ์ด ํ์ํ๋ค. | ||
|
|
||
| # 2๋จ๊ณ - ๊ธฐ๋ฌผ ์ด๋ | ||
|
|
||
| - 2๋จ๊ณ์์๋ ๊ธฐ๋ฌผ ์ด๋ ๊ตฌํ์ด ๋ชฉ์ ์ด๋๊น ์ข ๋ฃ๋ `Ctrl+C`๋ก ๊ฐ์ ์ข ๋ฃํ๋ค. | ||
|
|
||
| ## ์๋ชป๋ ๊ธฐ๋ฌผ ์ ํ ์๋๋ฆฌ์ค | ||
|
|
||
| 1. ๋ค๋ฅธ ๋๋ผ์ ๊ธฐ๋ฌผ์ ์ ํํ์ ๋ | ||
| 1. ์์ธ: ๋ค๋ฅธ๋๋ผ์ ๊ธฐ๋ฌผ ์ ํ | ||
| 2. `[ERROR] ๋ค๋ฅธ ๋๋ผ์ ๊ธฐ๋ฌผ์ ์ ํํ ์ ์์ต๋๋ค.` | ||
| 2. ๊ธฐ๋ฌผ์ด ์๋ ๊ณณ์ ์ ํํ๋ค. (๋น์นธ or ์ฅ๊ธฐํ ์ธ๋ถ) | ||
| 1. ์์ธ: ๊ธฐ๋ฌผ์ด ์๋ ๊ณณ์ ์ ํ | ||
| 2. `[ERROR] ํ์ฌ ์์น์ ์กด์ฌํ๋ ๊ธฐ๋ฌผ์ด ์์ต๋๋ค.` | ||
|
|
||
| ## ๊ธฐ๋ฌผ ์ด๋ ๊ท์น | ||
|
|
||
| - ๊ถ์ฑ ์์ญ - ๊ณ ๋ คํ์ง ์๋๋ค. (์ฌ์ดํด 2) | ||
| - ๊ธฐ๋ฌผ ์ด๋ ๊ท์น ๊ณตํต | ||
| - ํ์ฌ ์์น๋ก ์ด๋ํ ์ ์๋ค. | ||
| - ๋ณด๋ ์์ญ ๋ฐ์ผ๋ก ์ด๋ํ ์ ์๋ค. | ||
| - ๋ชฉ์ ์ง์ ์๊ตฐ์ด ์์ผ๋ฉด ์ด๋ํ ์ ์๋ค. | ||
| - ๋ชฉ์ ์ง์ ์ ๊ตฐ์ด ์์ผ๋ฉด ์ก์๋ธ๋ค. | ||
|
|
||
| - `์ฐจ`: 4๋ฐฉ์๋ก ์ด๋ํ๋ค. | ||
| - ๋ชฉ์ ์ง๊น์ง์ ๊ฒฝ๋ก์ ๊ธฐ๋ฌผ์ด ์์ผ๋ฉด ์ด๋ํ ์ ์๋ค. | ||
| - `ํฌ`: 4๋ฐฉ์๋ก ์ด๋ํ๋ค. | ||
| - ๋ฌด์กฐ๊ฑด ๋ชฉ์ ์ง๊น์ง์ ๊ฒฝ๋ก์ ํฌ๋ฅผ ์ ์ธํ ๊ธฐ๋ฌผ์ด ํ๋๋ง ์กด์ฌํด์ผ ํ๋ค. | ||
| - `๋ง`: 4๋ฐฉ์ ์ค ํ ๋ฐฉํฅ์ผ๋ก ํ ์นธ ์ด๋ํ๊ณ ๋๊ฐ์ ์ ํ ๋ฐฉํฅ์ผ๋ก 1์นธ ์ด๋ํด์ผ ํ๋ค. | ||
| - ๋ชฉ์ ์ง๊น์ง์ ๊ฒฝ๋ก์ ๊ธฐ๋ฌผ์ด ์์ผ๋ฉด ์ด๋ํ ์ ์๋ค. | ||
| - `์`: 4๋ฐฉ์ ์ค ํ ๋ฐฉํฅ์ผ๋ก ํ ์นธ ์ด๋ํ๊ณ ๋๊ฐ์ ์ ํ ๋ฐฉํฅ์ผ๋ก 2์นธ ์ด๋ํด์ผ ํ๋ค. | ||
| - ๋ชฉ์ ์ง๊น์ง์ ๊ฒฝ๋ก์ ๊ธฐ๋ฌผ์ด ์์ผ๋ฉด ์ด๋ํ ์ ์๋ค. | ||
| - `์กธ`: ์ง์ง๊ณผ ์ข, ์ฐ๋ก๋ง ํ ์นธ ์ด๋ํด์ผ ํ๋ค. | ||
| - ํ ์นธ์ด๋ผ์ ๊ฒฝ๋ก์ ๊ธฐ๋ฌผ์ด ์์ ๋ฆฌ๊ฐ ์๋ค. | ||
| - `์ฌ, ์ฅ`: ๊ถ์ฑ ์์ญ์ด๋ฏ๋ก ๊ตฌํํ์ง ์๋๋ค. | ||
|
|
||
| ## ์ ์ถ๋ ฅ ์์ | ||
|
|
||
| ``` | ||
| 1๋จ๊ณ ... | ||
|
|
||
| ใใใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผ | ||
| ใ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ | ||
| ๏ผ๏ฝใ่ปใ้ฆฌใ่ฑกใๅฃซใ๏ผใๅฃซใ่ฑกใ้ฆฌใ่ปใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใ๏ผใ๏ผใ๏ผใๆผขใ๏ผใ๏ผใ๏ผใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใๅ ใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใๅ ใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใๅ ตใ๏ผใๅ ตใ๏ผใๅ ตใ๏ผใๅ ตใ๏ผใๅ ตใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใๅใ๏ผใๅใ๏ผใๅใ๏ผใๅใ๏ผใๅใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใๅ ใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใๅ ใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใ๏ผใ๏ผใ๏ผใๆฅใ๏ผใ๏ผใ๏ผใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ่ปใ้ฆฌใ่ฑกใๅฃซใ๏ผใๅฃซใ่ฑกใ้ฆฌใ่ปใ๏ฝ | ||
| ใ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ | ||
|
|
||
| [์ด๋๋ผ] ์ด๋ํ ๊ธฐ๋ฌผ์ ์ ํํด์ฃผ์ธ์. (์ผํ ๊ธฐ์ค์ผ๋ก ๋ถ๋ฆฌ) | ||
| ๊ธฐ๋ฌผ: 6,8 | ||
|
|
||
| [์ด๋๋ผ] ๊ธฐ๋ฌผ ๅ์ ๋ค์ ์์น๋ฅผ ์ ํํด์ฃผ์ธ์. (์ผํ ๊ธฐ์ค์ผ๋ก ๋ถ๋ฆฌ) | ||
| ์์น: 6,7 | ||
|
|
||
|
|
||
| ใใใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผ | ||
| ใ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ | ||
| ๏ผ๏ฝใ่ปใ้ฆฌใ่ฑกใๅฃซใ๏ผใๅฃซใ่ฑกใ้ฆฌใ่ปใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใ๏ผใ๏ผใ๏ผใๆผขใ๏ผใ๏ผใ๏ผใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใๅ ใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใๅ ใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใๅ ตใ๏ผใๅ ตใ๏ผใๅ ตใ๏ผใๅ ตใ๏ผใๅ ตใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใๅใ๏ผใๅใ๏ผใๅใ๏ผใๅใๅใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใๅ ใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใๅ ใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใ๏ผใ๏ผใ๏ผใๆฅใ๏ผใ๏ผใ๏ผใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ่ปใ้ฆฌใ่ฑกใๅฃซใ๏ผใๅฃซใ่ฑกใ้ฆฌใ่ปใ๏ฝ | ||
| ใ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ | ||
|
|
||
| [ํ๋๋ผ] ์ด๋ํ ๊ธฐ๋ฌผ์ ์ ํํด์ฃผ์ธ์. (์ผํ ๊ธฐ์ค์ผ๋ก ๋ถ๋ฆฌ) | ||
| ๊ธฐ๋ฌผ: 3,1 | ||
|
|
||
| [ERROR] ํ์ฌ ์์น์ ์กด์ฌํ๋ ๊ธฐ๋ฌผ์ด ์์ต๋๋ค. | ||
|
|
||
|
|
||
| [ํ๋๋ผ] ์ด๋ํ ๊ธฐ๋ฌผ์ ์ ํํด์ฃผ์ธ์. (์ผํ ๊ธฐ์ค์ผ๋ก ๋ถ๋ฆฌ) | ||
| ๊ธฐ๋ฌผ: 3,0 | ||
|
|
||
|
|
||
| [ํ๋๋ผ] ๊ธฐ๋ฌผ ๅ ต์ ๋ค์ ์์น๋ฅผ ์ ํํด์ฃผ์ธ์. (์ผํ ๊ธฐ์ค์ผ๋ก ๋ถ๋ฆฌ) | ||
| ์์น: 3,1 | ||
|
|
||
| ใใใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผ | ||
| ใ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ | ||
| ๏ผ๏ฝใ่ปใ้ฆฌใ่ฑกใๅฃซใ๏ผใๅฃซใ่ฑกใ้ฆฌใ่ปใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใ๏ผใ๏ผใ๏ผใๆผขใ๏ผใ๏ผใ๏ผใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใๅ ใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใๅ ใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใๅ ตใๅ ตใ๏ผใๅ ตใ๏ผใๅ ตใ๏ผใๅ ตใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใๅใ๏ผใๅใ๏ผใๅใ๏ผใๅใๅใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใๅ ใ๏ผใ๏ผใ๏ผใ๏ผใ๏ผใๅ ใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ๏ผใ๏ผใ๏ผใ๏ผใๆฅใ๏ผใ๏ผใ๏ผใ๏ผใ๏ฝ | ||
| ๏ผ๏ฝใ่ปใ้ฆฌใ่ฑกใๅฃซใ๏ผใๅฃซใ่ฑกใ้ฆฌใ่ปใ๏ฝ | ||
| ใ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ๏ผ | ||
| ``` | ||
|
|
||
| ## ๊ตฌํ ์์ | ||
|
|
||
| 1. ๊ธฐ๋ฌผ ์ด๋ ๊ธฐ๋ฅ ์ถ๊ฐ | ||
| * ๋๋ผ ๋ณ ์ ๋ ฅ | ||
| * ์ด๋ํ ๊ธฐ๋ฌผ์ ์์น๋ฅผ ์ ๋ ฅ ๋ฐ๋๋ค. | ||
| * ํด๋น ์์น์ ๊ธฐ๋ฌผ์ด ์กด์ฌํ์ง ์๋ค๋ฉด ์์ธ๊ฐ ๋ฐ์ํ๋ค. | ||
| * ํด๋น ์์น์ ๊ธฐ๋ฌผ์ด ๋ค๋ฅธ ํ์ด๋ผ๋ฉด ์์ธ๊ฐ ๋ฐ์ํ๋ค. | ||
| * ์๋ชป๋ ๋ฒ์๋ผ๋ฉด ์์ธ๋ฅผ ๋ฐ์ํ๋ค. (๋ณด๋ ๋ฒ์ ๋ฒ์ด๋จ) | ||
| * ๊ธฐ๋ฌผ์ ์ด๋ํ ์์น๋ฅผ ์ ๋ ฅ ๋ฐ๋๋ค. | ||
| * ์๋ชป๋ ๋ฒ์๋ผ๋ฉด ์์ธ๋ฅผ ๋ฐ์ํ๋ค. | ||
| * ํด๋น ์์น์ ์๊ตฐ์ ๊ธฐ๋ฌผ์ด ์กด์ฌํ๋ค๋ฉด ์์ธ๊ฐ ๋ฐ์ํ๋ค. | ||
| * ๊ธฐ๋ฌผ ๋ณ๋ก ์ด๋ํ ์ ์๋ ๋ชฉ์ ์ง๋ผ๋ฉด ์์ธ๊ฐ ๋ฐ์ํ๋ค. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import controller.JanggiController; | ||
| import view.InputView; | ||
| import view.OutputView; | ||
|
|
||
| public class Application { | ||
| public static void main(String[] args) { | ||
| JanggiController janggiController = new JanggiController(new InputView(), new OutputView()); | ||
| janggiController.run(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| package controller; | ||
|
|
||
| import static controller.Retrier.retry; | ||
| import static model.Team.CHO; | ||
| import static model.Team.HAN; | ||
|
|
||
| import java.util.function.Consumer; | ||
| import model.JanggiGame; | ||
| import model.Team; | ||
| import model.board.Board; | ||
| import model.board.BoardFactory; | ||
| import model.board.JanggiFormation; | ||
| import model.board.Position; | ||
| import model.piece.Piece; | ||
| import view.InputView; | ||
| import view.OutputView; | ||
|
|
||
| public class JanggiController { | ||
| private final InputView inputView; | ||
| private final OutputView outputView; | ||
|
|
||
| public JanggiController(InputView inputView, OutputView outputView) { | ||
| this.inputView = inputView; | ||
| this.outputView = outputView; | ||
| } | ||
|
|
||
| public void run() { | ||
| Board board = createBoardByFormation(); | ||
| outputView.displayBoard(board.board()); | ||
|
|
||
| JanggiGame janggiGame = new JanggiGame(board); | ||
| while (true) { | ||
| retry(() -> playByTurn(janggiGame), processError()); | ||
| outputView.displayBoard(board.board()); | ||
| } | ||
| } | ||
|
|
||
| private Board createBoardByFormation() { | ||
| JanggiFormation hanFormation = retry(() -> inputView.readFormationByTeam(HAN), processError()); | ||
| JanggiFormation choFormation = retry(() -> inputView.readFormationByTeam(CHO), processError()); | ||
|
|
||
| Board board = BoardFactory.generateDefaultPieces(); | ||
| board.arrangePieces(hanFormation.generateByTeam(HAN)); | ||
| board.arrangePieces(choFormation.generateByTeam(CHO)); | ||
| return board; | ||
| } | ||
|
|
||
| private void playByTurn(JanggiGame janggiGame) { | ||
| Team currentTurn = janggiGame.getTurn(); | ||
|
|
||
| Position current = inputView.readPiecePositionForMove(currentTurn); | ||
| Piece piece = janggiGame.selectPiece(current); | ||
|
|
||
| Position next = inputView.readPiecePositionForArrange(currentTurn, piece); | ||
| janggiGame.movePiece(current, next); | ||
| } | ||
|
|
||
| private Consumer<IllegalArgumentException> processError() { | ||
| return (e) -> outputView.displayError(e.getMessage()); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package controller; | ||
|
|
||
| import java.util.function.Consumer; | ||
| import java.util.function.Supplier; | ||
|
|
||
| public final class Retrier { | ||
| private Retrier() { | ||
| } | ||
|
|
||
| public static <T> T retry(Supplier<T> task, Consumer<IllegalArgumentException> consumer) { | ||
| while (true) { | ||
| try { | ||
| return task.get(); | ||
| } catch (IllegalArgumentException e) { | ||
| consumer.accept(e); | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| public static void retry(Runnable task, Consumer<IllegalArgumentException> consumer) { | ||
| while (true) { | ||
| try { | ||
| task.run(); | ||
| return; | ||
| } catch (IllegalArgumentException e) { | ||
| consumer.accept(e); | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| package model; | ||
|
|
||
| import java.util.List; | ||
| import model.board.Board; | ||
| import model.board.Position; | ||
| import model.piece.Piece; | ||
|
|
||
| public class JanggiGame { | ||
|
|
||
| private final Board board; | ||
| private Team turn; | ||
|
|
||
| public JanggiGame(Board board) { | ||
| this.board = board; | ||
| this.turn = Team.CHO; | ||
| } | ||
|
|
||
| public void movePiece(Position current, Position next) { | ||
| Piece piece = selectPiece(current); | ||
|
|
||
| List<Position> path = piece.extractPath(current, next); | ||
| List<Piece> pieces = board.extractPiecesByPath(path); | ||
|
|
||
| piece.validatePathCondition(pieces); | ||
| board.move(current, next); | ||
|
|
||
| this.turn = turn.next(); | ||
| } | ||
|
|
||
| public Piece selectPiece(Position position) { | ||
| Piece piece = board.pickPiece(position); | ||
| turn.validateAlly(piece); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. turn์ validateAlly์์ piece์๊ฒ ๋ค์ turn์ ๋๊ฒจ์ ๊ฒ์ฆ์ ํ๊ณ ์๋๋ฐ ํธ์ถ ๊ตฌ์กฐ๋ฅผ ์ฌํํ๊ฒ ํ๋ฉด ์ข์ ๊ฒ ๊ฐ์์. ๊ฐ๋จํ JanggiGame์์์ validateAlly ๊ตฌํ์ ๋ฃ์ผ๋ฉด ๋ ๊ฒ ๊ฐ์ต๋๋ค. |
||
| return piece; | ||
| } | ||
|
|
||
| public Team getTurn() { | ||
| return turn; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| package model; | ||
|
|
||
| import model.piece.Piece; | ||
|
|
||
| public enum Team { | ||
| HAN("ํ๋๋ผ"), CHO("์ด๋๋ผ"); | ||
|
|
||
| private final String name; | ||
|
|
||
| Team(String name) { | ||
| this.name = name; | ||
| } | ||
|
|
||
| public void validateAlly(Piece piece) { | ||
| if (piece.isOtherTeam(this)) { | ||
| throw new IllegalArgumentException(this.name + "์ ๊ธฐ๋ฌผ์ด ์๋๋๋ค."); | ||
| } | ||
| } | ||
|
|
||
| public boolean isHan() { | ||
| return this == HAN; | ||
| } | ||
|
|
||
| public Team next() { | ||
| if (isHan()) { | ||
| return CHO; | ||
| } | ||
| return HAN; | ||
| } | ||
|
|
||
| public String getName() { | ||
| return name; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ ์ ๋ณด๋ฅผ Formation ๊ฐ์ฒด ์์ฑ ์ ์์ฑ์๋ก ์ ๋ฌํ๋ฉด ๋ฉ์๋ ์คํ ์ ํ๋ผ๋ฏธํฐ๋ก ์ ๋ฌํ ํ์๊ฐ ์์ ๊ฒ ๊ฐ์ต๋๋ค~