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
[쿠킴 / 땃쥐] 로또 2단계 - 보너스 번호 추가 #25
Conversation
- InputView.inputWinnigTicket에서 기존 당첨 번호와 보너스 번호 입력 받아 WinningTicket 객체 생성 - 당첨 번호와 보너스 번호 중복 시 예외 발생
- WinningTicket.match 메서드에 보너스 번호 유무 로직 추가 - Rank에 2등 enum과 toString 추가
- InputView.inputWinnigTicket -> InputView.inputWinningTicket
- getTotalReward -> getTotalRewards 메서드명 변경 - 기존 람다식에는 변수에 대한 설명이 없어 for문으로 변경하여 각 값들을 변수로 두어 의미 전달을 명확히 함
- READEME.md 파일에 step1과 step2 결과와 코드와 설명, 고민 점 작성
일단 스트림이 좋습니다 ㅎㅎㅎ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
참 로또 생성을 셋으로 반복적으로 겹치지 않게 생성하는 것보다는
1-46까지 리스트를 섞어서 앞에서 6개를 가져오는 편이 더 안정적입니다.
THIRD(5, 1_500_000L), | ||
FOURTH(4, 50_000L), | ||
FIFTH(3, 5_000L), | ||
FAILED(-1, 0L); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
매치 카운트라면 Failed는 0이 적합하지 않나요? -1인 이유가 있을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-1로 했던 이유는 5등 이외의 맞은 개수 0,1,2 개가 있기 때문에 통칭하여-1로 했습니다.
생각해보니 -1로 했을때 만약 FAILED의 rank 값을 외부에서 사용할 수 있기 때문에 -1이 문제가 될 수 있어보이네요!
감사합니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
참 로또 생성을 셋으로 반복적으로 겹치지 않게 생성하는 것보다는
1-46까지 리스트를 섞어서 앞에서 6개를 가져오는 편이 더 안정적입니다.
전반적으로 분리도 잘 되어 있고 코드고 깔끔해 보입니다.
수고하셨습니다!
코드 리뷰 감사합니다! |
인사
안녕하세요! 땃쥐, 쿠킴입니다.
이번 로또 미션 2단계 구현 결과물에 대해 풀리퀘스트 드립니다.
이전 리뷰(#13)에 대한 피드백
요구사항 및 반영 내역
고민 및 질문사항
LottoGameResults
getTotalReward()
메서드는 스트림으로 구현했다.entry.getKey().getReward()
나entry.getValue()
에 대한 의미를 파악하기 어려웠다.감사합니다!