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

[사다리 미션] 정상희 미션 제출합니다. #19

Open
wants to merge 54 commits into
base: sangheejeong
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
1196afa
[FEAT] Ladder & Line 클래스 생성
SANGHEEJEONG Oct 24, 2024
8b96693
[FEAT] Line 생성 메서드 작성 (1단계)
SANGHEEJEONG Oct 24, 2024
f20be9f
[FEAT] LineView Enum 클래스 생성 (1단계)
SANGHEEJEONG Oct 24, 2024
19995ef
[REFACTOR] domain과 view 분리 (1단계)
SANGHEEJEONG Oct 24, 2024
49d105c
[FEAT] Ladder 생성 메서드 작성 (1단계)
SANGHEEJEONG Oct 24, 2024
090cb0f
[FEAT] OutputView 메서드 작성 및 Main 구현 (1단계)
SANGHEEJEONG Oct 24, 2024
06a00a7
[FEAT] InputView 메서드 작성 및 Main 구현 (2단계)
SANGHEEJEONG Oct 25, 2024
3e47a2a
[FEAT] 사다리 방향 확인 메서드 작성 (3단계)
SANGHEEJEONG Oct 26, 2024
07fe975
[FEAT] 사다리 게임 실행 메서드 작성 (3단계)
SANGHEEJEONG Oct 26, 2024
2265787
[FEAT] 사다리 게임 실행 메서드 수정 (3단계)
SANGHEEJEONG Oct 26, 2024
2fef17c
[FIX] 사다리 방향 결정 인덱스 오류 수정(3단계)
SANGHEEJEONG Oct 26, 2024
f7ab094
[FEAT] 4단계 입력 메서드 작성 (4단계)
SANGHEEJEONG Oct 26, 2024
dbbb328
[FEAT] Players 클래스 생성 (4단계)
SANGHEEJEONG Oct 26, 2024
65d58d2
[FEAT] GameResult 클래스 생성 및 OutputView 메서드 작성 (4단계)
SANGHEEJEONG Oct 26, 2024
56b093f
[FEAT] main 작성 (4단계)
SANGHEEJEONG Oct 26, 2024
5c6b21e
[REFACTOR] decideWhereToGo 메서드 분리 (5단계)
SANGHEEJEONG Oct 26, 2024
67fcc5a
[REFACTOR] Player 객체 분리 (5단계)
SANGHEEJEONG Oct 29, 2024
74f098d
[REFACTOR] LadderGenerator 메서드 수정 (5단계)
SANGHEEJEONG Oct 29, 2024
9763754
[REFACTOR] LadderGame forEach 람다 형식으로 바꿔보기(5단계)
SANGHEEJEONG Oct 29, 2024
a16726a
[REFACTOR] OutputView 메서드 순서 수정(5단계)
SANGHEEJEONG Oct 29, 2024
69871ca
[REFACTOR] findPlayerByName 메서드를 Players로 책임 분리(5단계)
SANGHEEJEONG Oct 30, 2024
169ec00
[REFACTOR] OutputView 주석 및 수정 (5단계)
SANGHEEJEONG Oct 30, 2024
ea543eb
[REFACTOR] Name, Position 원시값 포장 (5단계)
SANGHEEJEONG Oct 30, 2024
e81fa34
[REFACTOR] Name 예외처리 (5단계)
SANGHEEJEONG Oct 30, 2024
047d483
[REFACTOR] ResultTypes 예외처리 (5단계)
SANGHEEJEONG Oct 30, 2024
2dfe464
[REFACTOR] Players 예외처리 (5단계)
SANGHEEJEONG Oct 30, 2024
42cdbd6
[REFACTOR] 입력 예외처리 (5단계)
SANGHEEJEONG Oct 30, 2024
62f451d
[REFACTOR] 불변객체 적용 (5단계)
SANGHEEJEONG Oct 30, 2024
422af42
[REFACTOR] 단위테스트 작성 (5단계)
SANGHEEJEONG Oct 30, 2024
494e2d9
[REFACTOR] 코드 정렬 (5단계)
SANGHEEJEONG Oct 30, 2024
b2b1220
Create README.md
SANGHEEJEONG Nov 2, 2024
7dbb8cd
[REFACTOR] 리뷰 반영
SANGHEEJEONG Nov 2, 2024
67b09e4
[REFACTOR] README 작성
SANGHEEJEONG Nov 2, 2024
5c280c4
[REFACTOR] README 수정
SANGHEEJEONG Nov 6, 2024
8eac61b
[REFACTOR] Controller 메서드 분리
SANGHEEJEONG Nov 6, 2024
beeb626
[REFACTOR] 미사용 import 정리
SANGHEEJEONG Nov 6, 2024
570c4d7
[REFACTOR] LadderGame 메서드 책임에 따른 클래스 분리
SANGHEEJEONG Nov 7, 2024
6f6b09a
[REFACTOR] 접근지정자 수정 public -> private
SANGHEEJEONG Nov 7, 2024
95f8ec1
[REFACTOR] Boolaen -> Point ENUM 사용
SANGHEEJEONG Nov 8, 2024
f31cacc
[REFACTOR] position 메서드 수정
SANGHEEJEONG Nov 8, 2024
e43ee2d
[REFACTOR] 입력 메서드 수정
SANGHEEJEONG Nov 8, 2024
7e4cd52
[REFACTOR] LadderController 수정
SANGHEEJEONG Nov 9, 2024
f8dce70
[REFACTOR] LadderGenerator 삭제 및 Controller 메서드 분리
SANGHEEJEONG Nov 16, 2024
ac02d9c
[REFACTOR] moveLeft & moveRight 예외 처리
SANGHEEJEONG Nov 16, 2024
d48bce2
[REFACTOR] Controller 와 Application 책임 분리
SANGHEEJEONG Nov 18, 2024
ea12de3
[REFACTOR] Ladder 클래스 책임 부여
SANGHEEJEONG Nov 18, 2024
01b8efe
[REFACTOR] decideWhereToGo 메서드 line 클래스 이동
SANGHEEJEONG Nov 18, 2024
7cf78a6
[REFACTOR] Point -> LadderStep 이름 변경 및 학습테스트(익명 클래스 & 인터페이스) 적용
SANGHEEJEONG Nov 18, 2024
174ff32
[REFACTOR] nextStep 미사용 인자 삭제
SANGHEEJEONG Nov 19, 2024
6b26030
[REFACTOR] 동명이인 예외 처리
SANGHEEJEONG Nov 19, 2024
1d96fb1
[REFACTOR] PlayerName VO로 만들기
SANGHEEJEONG Nov 20, 2024
0bd1928
[REFACTOR] test 수정
SANGHEEJEONG Nov 20, 2024
76e1d31
[REFACTOR] test 수정
SANGHEEJEONG Nov 20, 2024
6473cca
[REFACTOR] 코드 정렬
SANGHEEJEONG Nov 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[REFACTOR] OutputView 메서드 순서 수정(5단계)
SANGHEEJEONG committed Oct 29, 2024
commit a16726ad4dbd2aca54b5c1c557eebbf9155bb9ab
1 change: 0 additions & 1 deletion src/main/java/domain/LadderGame.java
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ public class LadderGame {

public List<Player> createPlayer(List<String> playerNames) {
List<Player> players = new ArrayList<>();

for (int i = 0; i < playerNames.size(); i++) {
players.add(new Player(playerNames.get(i), i));
}
2 changes: 1 addition & 1 deletion src/main/java/domain/LadderGenerator.java
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ private boolean randomTrueOrFalse() {
}

private boolean createValue(List<Boolean> line, int index) {
if (index != 0 && line.get(index - 1) == TRUE) // 이전 값이 True면 false 반환
if (index != 0 && line.get(index - 1) == TRUE) // 이전 값이 true 면 false 반환
return false;

return randomTrueOrFalse();
2 changes: 0 additions & 2 deletions src/main/java/domain/Player.java
Original file line number Diff line number Diff line change
@@ -11,12 +11,10 @@ public Player(String name,int position) {

public void moveLeft(){
position--;
System.out.println(getName()+getPosition());
}

public void moveRight(){
position++;
System.out.println(getName()+getPosition());
}

public String getName(){
2 changes: 1 addition & 1 deletion src/main/java/view/InputView.java
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ public static int inputHeight(){
}

public static String inputViewerName(){
System.out.println("결과를 보고 싶은 사람은?");
System.out.println("\n결과를 보고 싶은 사람은?");
return input.nextLine();
}
}
26 changes: 12 additions & 14 deletions src/main/java/view/OutputView.java
Original file line number Diff line number Diff line change
@@ -10,6 +10,13 @@
import static java.lang.Boolean.TRUE;

public class OutputView {

public static void printPlayers(List<String> names) {
System.out.println("\n사다리 결과\n");
names.forEach(System.out::print);
System.out.println();
}

private static String changeValueToView(Boolean point) {
if (point == TRUE)
return "-----";
@@ -25,13 +32,10 @@ private static void drawLine(Line line) {
System.out.println("|");
}

public static void printPlayers(List<String> names) {
System.out.println("\n사다리 결과\n");
System.out.println();
for (String name : names) {
System.out.print(name);
public static void drawLadder(Ladder Ladder) {
for (Line lines : Ladder.getLadder()) {
drawLine(lines);
}
System.out.println();
}

public static void printKindOfResults(List<String> kindOfResults) {
@@ -41,15 +45,9 @@ public static void printKindOfResults(List<String> kindOfResults) {
System.out.println();
}

public static void drawLadder(Ladder Ladder) {
for (Line lines : Ladder.getLadder()) {
drawLine(lines);
}
}

private static void printAllResult(Players players, List<String> kindOfResults) {
public static void printAllResult(Players players, List<String> kindOfResults) {
for (Player player : players.getPlayers()) {
System.out.println(player.getName() + " :" + kindOfResults.get(player.getPosition()));
System.out.println(player.getName() + " : " + kindOfResults.get(player.getPosition()));
}
}