{{ message }}
[사다리타기 - FP, OOP] 3단계 - 사다리(게임 실행)#1441
Merged
Merged
Conversation
step2 피드백 반영 - 매직 넘버, 매직 리터럴 상수로 분리 - Ladder -> Lines 일급 컬렉션으로 변경 - 사다리 게임 발판 전략 패턴 적용 - 출력 View StringBuilder 정적으로 선언해 재활용 하도록 구현 - 사다리 높인 경계값 테스트 및 파라미터 테스트 적용 - 플레이어명 비어있는 이름 예외 처리
사디리 포인트 이동(왼쪽, 오른쪽, 멈춤) 기능 구현. - 현재 포인트를 가지는 Point객체 추가 - 현재 이동 방향을 알 수 있는 Direction Enum 객체 추가.
사다리 특정 위치에서 시작해서 포인트 이동하는 기능 구현. - 현재 위치 값과 포인트를 가지는 Position 객체 추가
사다리 가로 라인 위치 이동 기능 구현. - Line 객체 추가 및 move 메서드 구현
실행결과는 쉼표(,)로 구분한다 - 실행결과를 가지는 Result 객체생성 - 실행결과들을 가지는 Results 일급컬렉션 객체 생성
포인트 값으로 실행결과 찾기 - 플레이어 이름으로 플레이어 시작 포인트 찾기 메서드 추가 - 실행결과 포인트로 실행결과 찾기 메서드 추가
사다리 실행 결과를 출력 - 사다리 실행 결과를 출력 - 개인별 이름을 입력하면 개인별 결과를 출력.
"all"을 입력하면 전체 참여자의 실행 결과를 출력. - all 입력 구분하여 결과 출력 분기
javajigi
approved these changes
Jun 4, 2022
javajigi
left a comment
Contributor
There was a problem hiding this comment.
전체적인 객체 설계, 클린코드, 테스트 코드 구현 잘 했네요. 👍
생성자로 하나만 추가하고 있는데요.
타입이 다른 생성자도 추가하고 그 효과를 느껴보면 좋겠네요.
다음 단계 진행할 때 피드백 반영해 보세요.
|
|
||
| public int point(String playerName) { | ||
| return point(new Player(playerName)); | ||
| } |
Contributor
There was a problem hiding this comment.
convention 위반
메서드 사이에 blank line을 추가하는 것이 convention
| public static final int MAX_NAME_LENGTH = 5; | ||
| private final String name; | ||
|
|
||
| public Player(String name) { |
| public Direction move() { | ||
| if (current) { | ||
| return Direction.RIGHT; | ||
| } else if (left) { |
Contributor
There was a problem hiding this comment.
early return을 하고 있으므로 굳이 else는 없어도 되지 않을까?
| public static final String JOINING_DELIMITER = " "; | ||
| private final List<Result> results; | ||
|
|
||
| public Results(List<Result> results) { |
Contributor
There was a problem hiding this comment.
생성자로 List외에 String과 같은 다른 type을 받는 생성자를 추가해 보는 것은 어떨까?
Contributor
There was a problem hiding this comment.
생성자로 List외에 String과 같은 다른 type을 받는 생성자를 추가해 보는 것은 어떨까?
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

안녕하세요!
[사다리타기 - FP, OOP] 3단계 - 사다리(게임 실행) 구현 완료하여 PR 드립니다!
2단계 피드백 내용도 작업하였습니다!
이번에도 리뷰 잘 부탁드릴게요!! :)
감사합니다!