Open
Conversation
ca1af
reviewed
Feb 3, 2026
| throw new IllegalArgumentException("숫자는 1-9 사이여야 합니다."); | ||
| } | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
숫자가 3이여야 한다는 것은 정책 아닌가? 이 숫자가 여러 번 등장하는데, 정책이 바뀔 때 마다 여러 번 등장하는 해당 숫자가 변경되어야 한다.
상수로 처리하거나, 로직을 변경하는 게 좋을 듯 하다
Comment on lines
+40
to
+46
| public static BaseBallNumbers parseIntegerList(String input) { | ||
| List<Integer> numbers = new ArrayList<>(); | ||
| for (char c : input.toCharArray()) { | ||
| numbers.add(Character.getNumericValue(c)); | ||
| } | ||
| return new BaseBallNumbers(numbers); | ||
| } |
Collaborator
There was a problem hiding this comment.
- 스태틱 메서드는 클래스 상단에 위치해야 한다. (생성자 위, 프로퍼티 아래)
- 유저의 인펏으로만 생성되는 인스턴스라면, 생성자는 private이어도 무관 할 것이다.
- 반드시 유저의 인펏으로만 생성된다면, 생성자 패러미터 자체를 Input 으로 변경해도 무방 할 것이다.
| inputHandler.close(); | ||
| } catch (IllegalArgumentException error) { | ||
| System.out.println(error.getMessage()); | ||
| System.exit(0); |
Comment on lines
+19
to
+22
| // 자릿수 체크 | ||
| if (input.length() != 3) { | ||
| throw new IllegalArgumentException("3자리 숫자를 입력하세요."); | ||
| } |
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.
숫자 야구게임 풀 리퀘스트