- ๊ฐ์ฒด์งํฅ์ ๋ํ์ฌ ์๊ฐํด๋ด ๋๋ค.
- ์งง๊ฒ ํ๋ ์ด ํ ์ ์๋ ๊ฒ์์ ์ง์ ๊ตฌํํด๋ด ๋๋ค.
- ์ธํฐํ์ด์ค๋ฅผ ํ์ฉํ์ฌ ํ๋ ์ดํ ์ ์๋ ๊ฒ์์ ๊ท๊ฒฉ์ ํต์ผํฉ๋๋ค.
Tag | Description |
---|---|
Init | ๋ ํฌ์งํ ๋ฆฌ ์์ฑ ํ ์ต์ด์ ์ปค๋ฐ |
Create | .java ํ์ผ ๋ฐ ์๋ก์ด class ์์ฑ |
Feat | ๊ธฐ๋ฅ ๊ตฌํ์ |
Mod | ์ปค๋ฐ์ด ์๋ฃ๋ ์ฝ๋๋ฅผ ์์ |
Fix | ๊ตฌํ๋ ๊ธฐ๋ฅ์ ๋ฒ๊ทธ ๋ฐ ์ค๋ฅ๋ฅผ ๋ฐ๊ฒฌํ๊ณ ์์ ์๋ฃ |
Refactor | ๊ตฌํ๋ ๊ธฐ๋ฅ๋ณํ ์์ด ๋ ํจ์จ ์ข์ ๊ตฌ์กฐ๋ก ๋ณ๊ฒฝ |
Test | ํ ์คํธ ์ฝ๋ ์ถ๊ฐํ ๋์ํ์ธ ๋ฐ ์์ (ํ๋ก๋์ ์ฝ๋ ์์ X) |
Docs | README.md ์ ๊ฐ์ ๋ฌธ์ ์์ |
Style | ์ฝ๋์ ๋ณ๊ฒฝ ์์ด ์ฝ๋ ํฌ๋ฉงํ , ์ธ๋ฏธ์ฝ๋ก ๋๋ฝ์๋ํ ์์ (ํ๋ก๋์ ์ฝ๋ ์์ X) |
Chore | ๋น๋ ์ค์ , ํจํค์ง ๋งค๋์ ์ค์ (ํ๋ก๋์ ์ฝ๋ ์์ X) |
Remove | ํ์ผ ์ญ์ |
Rename | ํ์ผ ํน์ ํด๋๋ช ์ ์์ ํ ๊ฒฝ์ฐ |
์ปค๋ฐ ํฌ๋งท
Tag : ์ปค๋ฐ ๋ฉ์์ง
ex)
$ git commit -m"Feat : TicTacToe ์น๋ฆฌ ์กฐ๊ฑด ์ฒดํฌ"
-
Tag์ ์๊ธ์๋
๋๋ฌธ์
๋ก ์์ฑํฉ๋๋ค. - Tag๋ฅผ ๊ธฐ์
ํ ํ์นธ์ ๊ณต๋ฐฑํ
:
์ ๊ธฐ์ ํ๊ณ ๋ค์ ํ ๋ฒ ํ ์นธ์ ๊ณต๋ฐฑ์ ๊ธฐ์ ํ๊ณ ์ปค๋ฐ ๋ฉ์์ง๋ฅผ ์์ฑํฉ๋๋ค.
ex)Style : {์ปค๋ฐ ๋ฉ์์ง}
- ์ปค๋ฐ ๋ฉ์์ง๋ ๋๋๋ก ์์ธํ๊ฒ ์์ฑํฉ๋๋ค.
- โโ ๊ฐ์์
fork
๋ฐ์ ๋ ํฌ์งํ ๋ฆฌ์์ ๋ธ๋์น๋ฅผ ์์ฑํ์ฌ ์์ ํmain
๋ธ๋์น๋กmerge
ํ๊ธฐ ์ ์ ๋ฐ๋์fork
๋ฐ์ ๋ ํฌ์งํ ๋ฆฌ์์Sync Fork
ํ์git pull origin main
๋ช ๋ น์ด๋กpull
์ ๋ฐ์์ฃผ์ธ์.
GameUtil
ํด๋์ค๋ ๊ฐ๊ฐ์ ๊ฒ์ ๋ชจ๋ ์ ์์์ ํธ์์ฑ์ ์ํ ๋ฉ์๋๋ฅผ ํฌํจํ๊ณ ์์ต๋๋ค.
public static String fontColor(String color, String words) {
return colorList.get(color) + words + "\u001B[0m";
}
colorFont()
๋ ๊ฒ์๋ชจ๋ ์ ์์ ์ฝ์์ฐฝ์ ํฐํธ์์ ๋ณ๊ฒฝ ํ ์ ์๋ ๊ธฐ๋ฅ์ ์ง์ํฉ๋๋ค.
fontColor({String : ์}, {String : ๋ฌธ์});
ex)
fontColor("red", "X")
![image](https://private-user-images.githubusercontent.com/118647313/344451809-948f2e83-3058-44a3-ab26-6145f94ddd03.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUzNDE1ODYsIm5iZiI6MTcyNTM0MTI4NiwicGF0aCI6Ii8xMTg2NDczMTMvMzQ0NDUxODA5LTk0OGYyZTgzLTMwNTgtNDRhMy1hYjI2LTYxNDVmOTRkZGQwMy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTAzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkwM1QwNTI4MDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wNjcxYzUxZDRiNjA0OWE2NzNmYmQwMWI3NzY2MjFkOTUxNWU5NzJhOTUwMTYxNjk5NjZjNmFiZDgxOTVjYjk4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.6xie81BcVjBkkLf7XFhC0mIV9IVUyeFaMLk5b1LLDjY)
์ด๋ฏธ์ง์ ๊ฐ์ด "X"
๊ฐ "red"
๋ก ๋ํ๋ฉ๋๋ค.
- black
- red
- green
- yellow
- blue
- purple
- cyan
- white
waitSecond()
๋ Thread
๋ฅผ ๊ธฐ๋ฐ์ผ๋ก "์ด"(second)
๋จ์๋ก "์ง์ฐ"(delay)
์ ์ค ์ ์์ต๋๋ค. waitSecond()
๋ ๊ฒ์ ๋ชจ๋ ๋ด๋ถ์ ์์ธ๋ฅผ ์์ฑํ์ง ์๊ณ "์ง์ฐ"(delay)
์ ์ฃผ๊ณ ์ ํ๋ ๋ชฉ์ ์ผ๋ก ๋ง๋ค์์ต๋๋ค.
ex)
private void ready() {
int count = 3;
waitSecond(); // 1์ด ์ง์ฐ
for (int i = count; i > 0; i--) {
System.out.println(i + "!");
waitSecond(); // 1์ด ์ง์ฐ
}
System.out.println("Battle!");
waitSecond(); // 1์ด ์ง์ฐ
}
TicTacToe๋ ๋จ์ํ ์๋ฐ๊ฐ์ง๊ณ ์งง์ ๊ฒ์์ ๋ง๋ค๋ค๊ฐ ๋ค๋ฅธ ๊ฒ์๋ ํ ์ ์๋๋ก ํ์ฅ์ฑ์ ์๊ฐํ๋ค๊ฐ GameManager๋ก ํ์ฅ๋์์ต๋๋ค.
src
manager ํจํค์ง
GameLauncher : Playable ํ์ ๋ง ์คํ์ด ๊ฐ๋ฅํ๋๋ก ๊ฐ์ ํฉ๋๋ค. GameManager๊ฐ ์คํ ์ ์ ํํ ๊ฒ์์ ์คํํ๋๋ก ํฉ๋๋ค.
GameList : ๋ง๋ ๊ฒ์์ ๋ฆฌ์คํธ๋ฅผ ์ ์ฅํฉ๋๋ค. GameList๋ฅผ ๋ฐํ์ผ๋ก GameManager ์ ํ์ง๋ฅผ ํ์ํฉ๋๋ค.
GameManager : ์ฑ๊ธํค์ผ๋ก ์ ํ๋ฆฌ์ผ์ด์ ์คํ์ ์๋์ผ๋ก ํ ๋ฒ๋ง ์์ฑ๋ฉ๋๋ค. ์ฌ์ฉ์์ UI์ ์กฐ์ํ ์ ์๋ ๋ช ๋ น์ ์ ๊ณตํฉ๋๋ค.module ํจํค์ง
Playable : GameLauncher๊ฐ ๊ฒ์์ ์คํํ๊ธฐ ์ํด์๋ Playable ์ธํฐํ์ด์ค์ ๋ฉ์๋๋ฅผ ๊ตฌํํด์ผ ํฉ๋๋ค.
TicTacToe : TicTacToe ๊ฒ์์ ์ฝ๋๊ฐ ์์ฑ๋์ด์์ต๋๋ค.
ํ์ ์ ํ ์ขํ๊ฐ์ ์คํ์ด์ค๋ก ๊ตฌ๋ถํ์ฌ ์ ๋ ฅํ๋ฉด O, X๋ฅผ ํ์ ํ ์ ์์ต๋๋ค.
![แแ
ณแแ
ณแ
แ
ตแซแแ
ฃแบ 2024-06-02 แแ
ฉแแ
ฎ 5 43 25](https://private-user-images.githubusercontent.com/118647313/335850959-c98a96bd-5c28-43fd-93ba-149f39edd003.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUzNDE1ODYsIm5iZiI6MTcyNTM0MTI4NiwicGF0aCI6Ii8xMTg2NDczMTMvMzM1ODUwOTU5LWM5OGE5NmJkLTVjMjgtNDNmZC05M2JhLTE0OWYzOWVkZDAwMy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTAzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkwM1QwNTI4MDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04Mjg5YWZiMWRmYjU1MWJmNzEwOTU5Y2M2NzJhYzJhOGYzMGZmMmU3NzlkMmIxMmVjM2IzOGIxYWRmMzc4ODk3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.7-0qT-0WsYtnh8T5rw8_CPw-6DQgKpEmFsaTx60oM1A)
![image](https://private-user-images.githubusercontent.com/118647313/335851378-39bb18fc-cd99-4a18-8821-efbd749b6e6d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUzNDE1ODYsIm5iZiI6MTcyNTM0M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TI4MDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03MTFlYjIxMjVkMmE4MjE4Y2IxMmMwYWI4YmVkN2Q3NDMwNDVhZWJmYTI5MjY2MTI5ZDdkZGEwNjU5OTFlYzgyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.BTkBBqlqWgS7rztM3GOev65-AbEQjByv3DW9Lfk3FY0)
![image](https://private-user-images.githubusercontent.com/118647313/344452547-af895927-db7d-45b3-8333-cdc1722d5d3e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUzNDE1ODYsIm5iZiI6MTcyNTM0MTI4NiwicGF0aCI6Ii8xMTg2NDczMTMvMzQ0NDUyNTQ3LWFmODk1OTI3LWRiN2QtNDViMy04MzMzLWNkYzE3MjJkNWQzZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTAzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkwM1QwNTI4MDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mZDdhNmI3YTY2M2E0N2MyNjM1N2ZhYjgyMjVhZTZkMzNkYzA1NzQxOTE3MjY5ODZkY2Y0OTBiYTdiMWM2NzU5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.dJ_Ru3lxmHxFZQrEtGOuQ1hIbxc5g--8uACZPVBgKgw)
![image](https://private-user-images.githubusercontent.com/118647313/344452573-610da9e5-158c-4599-afc7-feb717dcda0f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUzNDE1ODYsIm5iZiI6MTcyNTM0MTI4NiwicGF0aCI6Ii8xMTg2NDczMTMvMzQ0NDUyNTczLTYxMGRhOWU1LTE1OGMtNDU5OS1hZmM3LWZlYjcxN2RjZGEwZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTAzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkwM1QwNTI4MDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kZjQyZDRhZjVlYjhjMjViN2YyZDVkN2QzZWUwNzZjNDEyMzAwYTBjZTM0N2Q3NzI5YzAwYmE0YzUwMDhhOWUyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.IxL9ZXKYlxBiDgbp2q-hua41vvxw0Efjzys7UNEQLj8)
์ ๋ ฅ ์์๋ A B ๋๋ a b ์ฎ๊ธธ ํ์ฌ ์์น์์, ์ฎ๊ฒจ์ง ์์น๋ฅผ ๋ปํฉ๋๋ค.
![Hanoi_start](https://private-user-images.githubusercontent.com/128995184/344450252-89ad8f17-96ae-43d1-b15a-94bc4c2bc45f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHA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kZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkwM1QwNTI4MDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hOWYzZTY5MWNhZDJmNzFhZjllZjZmZmEzNjZjOWI2MGRkNWFlYTQwZjk2MTllZWViNjY1OGQzMGZiMzgzZjFmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.yWQ2Or94YmsxJ-SYrT_vNK3iuW9RBSEAEjiNBaLiZ0s)
๊ฒ์์ ๋ชฉํ๋ ๊ฐ๋ก, ์ธ๋ก ๋๋ ๋๊ฐ์ ์ผ๋ก ๋ค์ฏ ๊ฐ์ ๋์ ์ฐ์์ผ๋ก ๋๋ ๊ฒ์ ๋๋ค.
ํ์ฌ ์ด๋ ํ ๋ฃฐ๋ ์๋ 1๋ฒ ๋ชจ๋๋ง ๊ตฌํ์ด ๋์ด ์์ต๋๋ค.
์ถํ์ OOP ์ ์ผ๋ก ํ์ฅํ์ฌ ์ผ๋ฐ๋ฃฐ๊ณผ ๋ ์ฃผ๋ฃฐ์ด ์ ์ฉ๋ ์ค๋ชฉ์ ๊ตฌํํ ์์ ์
๋๋ค.