Conversation
기능 구현 설명
로또 구입 금액 입력 및 예외 처리 기능 추가
로또 개수 구하기 및 로또 발행
daeGULLL
reviewed
Feb 27, 2025
daeGULLL
left a comment
There was a problem hiding this comment.
아주아주 깔끔한 코드였어용!! 저번에 비해 어마어마하게 실력이 느신것 같아서 감탄햇슴니다..ㅎㅎ 짱 대단하심 마지막 주차 과제 어려운데 다 같이 힘내봐용..ㅠㅠ
| results.put(4, 0); | ||
| results.put(5, 0); | ||
| results.put(6, 0); | ||
| results.put(7, 0); // 5개 + 보너스 |
There was a problem hiding this comment.
빠른 조회 및 입력을 신경써서 map을 한것 굉장히 좋은 시도라고 생각합니다!! 그런데 map이 은근 무거운편이라 길이 5짜리 배열을 쓰셔도 될것 같아용 이건 제 개인적인 코드 취향이라 무시하셔도 됨~~
| if (winningNumbers.contains(num)) { | ||
| count++; | ||
| } | ||
| } |
There was a problem hiding this comment.
for문 말고 .stream()을 활용해보셔도 좋을 것 같아요! 더 간결하게 나올수도 있슴다
|
|
||
| public class InputView { | ||
| public static int readMoney() { | ||
| System.out.println("구입금액을 입력해 주세요."); |
There was a problem hiding this comment.
이런 시스템 메세지들을 enum으로 따로 빼서 관리하셔도 좋을 것 같아용!!
| throw new IllegalArgumentException("구입 금액은 1,000원 단위여야 합니다."); | ||
| } | ||
| return Integer.parseInt(input); | ||
| } |
There was a problem hiding this comment.
이런 validate 함수들은 뷰에 넣으면 조금 부적합할수도 있을 것 같아요, 따로 Validator파일을 만들어서 Validator 클래스 아래로 여러 검증 메서드를 가지게 해도 될 것같아요!
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.
No description provided.