Skip to content
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

[Step2] ๐Ÿš€ 2๋‹จ๊ณ„ - ์‚ฌ๋‹ค๋ฆฌ(์ƒ์„ฑ) #1776

Open
wants to merge 16 commits into
base: simjung
Choose a base branch
from

Conversation

SimJung
Copy link

@SimJung SimJung commented May 17, 2023

์•ˆ๋…•ํ•˜์„ธ์š”.
2๋‹จ๊ณ„ - ์‚ฌ๋‹ค๋ฆฌ(์ƒ์„ฑ) ๋ฏธ์…˜ ์ง„ํ–‰ํ•˜์—ฌ PR ๋“œ๋ฆฝ๋‹ˆ๋‹ค.
์ƒ๊ฐ๋ณด๋‹ค ๋‚œ์ด๋„๊ฐ€ ์žˆ์–ด ์‹œ๊ฐ„์ด ์ข€ ๊ฑธ๋ ธ์Šต๋‹ˆ๋‹ค.

๊ธฐ๋Šฅ ์š”๊ตฌ์‚ฌํ•ญ

  • ์‚ฌ๋‹ค๋ฆฌ ๊ฒŒ์ž„์— ์ฐธ์—ฌํ•˜๋Š” ์‚ฌ๋žŒ์— ์ด๋ฆ„์„ ์ตœ๋Œ€5๊ธ€์ž๊นŒ์ง€ ๋ถ€์—ฌํ•  ์ˆ˜ ์žˆ๋‹ค. ์‚ฌ๋‹ค๋ฆฌ๋ฅผ ์ถœ๋ ฅํ•  ๋•Œ ์‚ฌ๋žŒ ์ด๋ฆ„๋„ ๊ฐ™์ด ์ถœ๋ ฅํ•œ๋‹ค.
  • ์‚ฌ๋žŒ ์ด๋ฆ„์€ ์‰ผํ‘œ(,)๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๊ตฌ๋ถ„ํ•œ๋‹ค.
  • ์‚ฌ๋žŒ ์ด๋ฆ„์„ 5์ž ๊ธฐ์ค€์œผ๋กœ ์ถœ๋ ฅํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์‚ฌ๋‹ค๋ฆฌ ํญ๋„ ๋„“์–ด์ ธ์•ผ ํ•œ๋‹ค.
  • ์‚ฌ๋‹ค๋ฆฌ ํƒ€๊ธฐ๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ๋™์ž‘ํ•˜๋ ค๋ฉด ๋ผ์ธ์ด ๊ฒน์น˜์ง€ ์•Š๋„๋ก ํ•ด์•ผ ํ•œ๋‹ค.
  • |-----|-----| ๋ชจ์–‘๊ณผ ๊ฐ™์ด ๊ฐ€๋กœ ๋ผ์ธ์ด ๊ฒน์น˜๋Š” ๊ฒฝ์šฐ ์–ด๋Š ๋ฐฉํ–ฅ์œผ๋กœ ์ด๋™ํ• ์ง€ ๊ฒฐ์ •ํ•  ์ˆ˜ ์—†๋‹ค.

PS.
PR ์˜ฌ๋ฆฌ๊ณ ๋‚˜๋‹ˆ ์ด์ „ ์Šคํ… ์ปค๋ฐ‹๊นŒ์ง€ ์„ž์—ฌ์žˆ๋Š”๊ฑธ ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค..
squash&merge ์ดํ›„ ๋กœ์ปฌ์—์„œ pull๋ฐ›๊ณ  ์ง„ํ–‰ํ–ˆ๋Š”๋ฐ ํ—ท๊ฐˆ๋ฆฌ๋„ค์š” ใ…œใ…œ

SimJung added 16 commits May 13, 2023 02:56
- VerticalLine ๋ฐ ์ปฌ๋ ‰์…˜ ํด๋ž˜์Šค ์ถ”๊ฐ€
- HorizontalLine ๋ฐ ์ปฌ๋ ‰์…˜ ํด๋ž˜์Šค ์ถ”๊ฐ€
 - view ํŒจํ‚ค์ง€ ์ถ”๊ฐ€
@SimJung SimJung changed the title Step2 [Step2] ๐Ÿš€ 2๋‹จ๊ณ„ - ์‚ฌ๋‹ค๋ฆฌ(์ƒ์„ฑ) May 17, 2023
Copy link

@shared-moon shared-moon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ •๋‹˜ ์•ˆ๋…•ํ•˜์„ธ์š”!
2๋‹จ๊ณ„ ๋ฏธ์…˜ ์ž˜ ์ง„ํ–‰ ํ•ด ์ฃผ์…จ๋„ค์š” :)
์ฝ”๋ฉ˜ํŠธ๋ฅผ ์ข€ ๋‚จ๊ฒจ ๋‘์—ˆ๋Š”๋ฐ, ๋‹ค์Œ ๋ฏธ์…˜ ์ „์— ์‚ดํŽด๋ณด๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”!
ํ™•์ธ ํ›„ ๋ฆฌ๋ทฐ ์žฌ์š”์ฒญ ๋ถ€ํƒ๋“œ๋ฆด๊ฒŒ์š”!


public class Main {
public static void main(String[] args) {
Players players = PlayersGenerator.create(InputView.getPlayerNames());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InputView.getPlayerNames() ๋Š” ๋ณ€์ˆ˜๋กœ ํ•œ๋ฒˆ ๋นผ๋Š” ๊ฑด ์–ด๋–จ๊นŒ์š” ?

public static void main(String[] args) {
Players players = PlayersGenerator.create(InputView.getPlayerNames());
int width = players.getPlayerNumber();
System.out.println();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ค„๋ฐ”๊ฟˆ์€ ๊ผญ ์—ฌ๊ธฐ์„œ ํ•ด ์ค˜์•ผ ํ• ๊นŒ์š” ?

System.out.println();

Ladder ladder = new LadderGenerator().generate(height, width);
ResultView.showResultMessage();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด ์„ธ ๊ฐœ๋ฅผ ๋ฌถ๋Š” ํ•จ์ˆ˜๋ฅผ ๋”ฐ๋กœ ์ œ๊ณตํ•ด์ฃผ๋Š” ๊ฑด ์–ด๋–จ๊นŒ์š” ?

@@ -0,0 +1,9 @@
package ladder.exception;

public class ContinuousHorizontalLineException extends RuntimeException {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ƒ์„ธํ•œ ์˜ˆ์™ธ ์„ ์–ธ ์ข‹๋„ค์š” ๐Ÿ‘

import java.util.HashSet;
import java.util.Set;

public class LadderGenerator {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด ํด๋ž˜์Šค๋Š” ์œ ํ‹ธ ํด๋ž˜์Šค๋กœ ์„ ์–ธ ํ•ด ๋ณด๋Š” ๊ฑด ์–ด๋–จ๊นŒ์š” ? Strategy๋ฅผ generate์—์„œ ๋ฐ›์•„๋„ ๋  ๊ฒƒ ๊ฐ™์•„์„œ์š”!

import java.util.stream.Collectors;

public class HorizontalLines {
private final Set<HorizontalLine> horizontalLineSet;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ํ˜น์‹œ ์ž๋ฃŒ๊ตฌ์กฐ๋ฅผ Set์œผ๋กœ ์ •ํ•˜์‹  ์ด์œ ๊ฐ€ ์žˆ์„๊นŒ์š” ?

VerticalLine nowVerticalLine = verticalLines.getVerticalLineByIndex(i);
VerticalLine nextVerticalLine = verticalLines.getVerticalLineByIndex(i + 1);

boolean notExistPreviousHorizontalLine = sameHeightHorizontalLineHashSet.stream()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด๋ ‡๊ฒŒ ๋‹ค ๋น„๊ตํ•ด์•ผ ํ• ๊นŒ์š” ? ์–ด์ฐจํ”ผ ์ˆœ์ฐจ์ฒ˜๋ฆฌ๋ฅผ ํ•˜๋Š”๊ฑฐ๋ผ๋ฉด ์ด์ „ ์นธ์—์„œ ์ƒ์„ฑ์„ ํ–ˆ๋Š”์ง€๋งŒ ํ™•์ธํ•˜๋ฉด ๋  ๊ฒƒ ๊ฐ™์•„์„œ์š”!

@@ -0,0 +1,5 @@
package ladder.domain;

public interface LadderGenerateStrategy {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ธํ„ฐํŽ˜์ด์Šค ํ™œ์šฉ ์ข‹๋„ค์š”! ํ˜น์‹œ domain ํŒจํ‚ค์ง€ ๋‚ด๋ถ€์—์„œ๋„ ๊ด€๊ณ„์žˆ๋Š” ํด๋ž˜์Šค๋ผ๋ฆฌ ๋”ฐ๋กœ ํŒจํ‚ค์ง• ํ•  ์ˆ˜๋Š” ์—†์„๊นŒ์š” ?

}
}

private void checkValidLines(VerticalLines verticalLines, HorizontalLines horizontalLines) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์š” ์œ ํšจ์„ฑ๊ฒ€์‚ฌ ํ˜น์‹œ ๊ผญ ํ•„์š” ํ• ๊นŒ์š” ? ์•ž์— VerticalLines์™€ HorizontalLines๋ฅผ ๋งŒ๋“ค ๋•Œ ์ด๋ฏธ ๊ฒ€์ฆ ๋˜๊ณ  ์žˆ๋Š” ๊ฒƒ ๊ฐ™์•„์„œ์š”!


import java.util.Set;

public class Ladder {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์‚ฌ๋‹ค๋ฆฌ๋ฅผ ๊ฐ€๋กœ์„  / ์„ธ๋กœ์„ ์˜ ๊ฐœ๋…์œผ๋กœ ์ ‘๊ทผํ•˜๋ฉด์„œ ๋กœ์ง์ด ๋งŽ์ด ๋ณต์žกํ•ด ์ง„ ๊ฒƒ ๊ฐ™์•„์š”!
์‚ฌ๋‹ค๋ฆฌ ํ•œ์นธ ํ•œ์นธ์„ ์ ์œผ๋กœ ๋ฐ”๋ผ๋ณด๊ณ , ๊ฐ ์ ์—์„œ ์‚ฌ๋‹ค๋ฆฌ์˜ ์œ ๋ฌด๋ฅผ ํŒ๋‹จํ•˜๋Š” ์‹์œผ๋กœ ๊ฐœ๋…์„ ์กฐ๊ธˆ ๋ฐ”๊พธ๋ฉด ์‰ฝ๊ฒŒ ์ ‘๊ทผ ํ•  ์ˆ˜ ์žˆ์ง€ ์•Š์„๊นŒ์š” ?
4๋ช…์˜ ํ”Œ๋ ˆ์ด์–ด, ๋†’์ด 4์˜ ์‚ฌ๋‹ค๋ฆฌ๋ผ๋ฉด
[x][o][x]
[o][x][o]
[o][x][o]
[x][x][o]
์ด๋Ÿฐ์‹์œผ๋กœ์š”!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants