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

[사다리 미션] 이현수 미션 제출합니다. #3

Open
wants to merge 1 commit into
base: 20hyeonsulee
Choose a base branch
from

Conversation

20HyeonsuLee
Copy link

뭔가 최대한 깔끔하게 짜려고 노력하긴했는데 깔끔하게 하려다보면 늪에 빠져버릴 것 같아서 이쯤에서 제출합니다.

이번에는 디버깅툴을 사용하면서 프로그램을 짜봤습니다.
확실히 디버깅툴을 사용하는게 print로 디버깅하는것 보다 좋네요!

Copy link

@Choon0414 Choon0414 left a comment

Choose a reason for hiding this comment

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

코드가 복잡해질 만 한 부분들을 풀어서 간결하게 잘 작성해주신 것 같아요.
고생하셨습니다!

return currentColumn;
}

private boolean canMoveLeft(Integer currentColumn, Line line) {

Choose a reason for hiding this comment

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

이동도 메서드로 하나하나 분리해주니 훨씬 눈에 잘 들어오네요

Copy link
Author

Choose a reason for hiding this comment

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

이부분 어떻게 깔끔하게 할지 고민을 많이 했던 것 같습니다!


public Players(List<String> playerNames) {
if (playerNames.stream().distinct().count() != playerNames.size()) {
throw new IllegalArgumentException("중복된 플레이어 이름이 존재합니다.");

Choose a reason for hiding this comment

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

예외처리 잘 해주셨네요! 이름 중복검사를 생각 못했네요

System.out.println("실행 결과를 입력하세요. (결과는 쉼표(,)로 구분하세요)");
List<String> results = Arrays.asList(SCAN.nextLine().split(","));
if (results.size() != playerCount) {
throw new IllegalArgumentException("게임의 결과의 개수는 플레이어의 수와 같아야합니다.");

Choose a reason for hiding this comment

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

👍

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