forked from next-step/java-lotto
-
Notifications
You must be signed in to change notification settings - Fork 2
미션4_로또 게임 수동 #12
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
Open
babysean
wants to merge
24
commits into
Doolki:psh
Choose a base branch
from
babysean:미션_4-로또게임_수동
base: psh
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
The head ref may contain hidden characters: "\uBBF8\uC158_4-\uB85C\uB610\uAC8C\uC784_\uC218\uB3D9"
Open
미션4_로또 게임 수동 #12
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
b4287d6
Merge pull request #5 from babysean/미션_3-로또게임_2등
babysean d6529c2
chore: 수동 로또 번호 구매 로직 추가
babysean 02dde32
test: 테스트 코드 추가
babysean e25d0e0
test: 테스트 코드 오타 수정
babysean 9dc4cce
refactor: 코드 컨벤션에 맞추어 format 변경
babysean f0e2d5c
chore: 로또 티켓 합치기
babysean 2338e36
test: 로또 티켓 개수 확인 테스트 코드 수정
babysean 5dbd0e7
refactor: 클래스 이름 변경
babysean c6429fb
refactor: 메서드 이름 변경
babysean 6576481
refactor: 클래스 생성 구문 위치 변경
babysean e94b114
refactor: 로또 번호 생성 주체 변경
babysean 2a6e1b6
refactor: 주석 및 줄바꿈 제거
babysean e3c822c
refactor: 수동 로또 티켓 구매 프로세스 수정
babysean ab04122
test: LottoService 테스트 코드 추가
babysean 0471dfb
test: LottoCalculator 테스트 코드 수정
babysean 442c41c
chore: 수동 로또 개수 final 선언
babysean d3d0aba
chore: 수동 로또 개수 final 키워드 제거
babysean 167e34a
refactor: LottoGenerator 파일명 변경
babysean 37aa7fb
chore: LottoTicketGenerator 의존성 해결
babysean 51a569e
refactor: 상수 관리 대상 변경
babysean eb6d329
refactor: 전략 패턴 적용
babysean a913957
test: 테스트 코드 작성
babysean 6d38f29
test: 테스트 코드 수정
babysean 032c611
refactor: javadoc 수정
babysean File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| package lotto.domain; | ||
|
|
||
| import static lotto.domain.LottoTicket.MAX_LOTTO_NUMBER; | ||
| import static lotto.domain.LottoTicket.MIN_LOTTO_NUMBER; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.Arrays; | ||
| import java.util.Collections; | ||
| import java.util.List; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| public class LottoTicketGenerator { | ||
|
|
||
| /** | ||
| * 자동 로또 번호를 생성하고 반환합니다. | ||
| * | ||
| * @return List<Integer> 생성된 로또 티켓 목록 | ||
| */ | ||
| public LottoTicket autoGenerate() { | ||
| List<Integer> numbers = new ArrayList<>(); | ||
|
|
||
| for (int i = MIN_LOTTO_NUMBER ; i <= MAX_LOTTO_NUMBER ; i++) { | ||
| numbers.add(i); | ||
| } | ||
|
|
||
| Collections.shuffle(numbers); | ||
|
|
||
| List<Integer> shuffledNumber = numbers.subList(0, 6); | ||
|
|
||
| Collections.sort(shuffledNumber); | ||
|
|
||
| return new LottoTicket(shuffledNumber); | ||
| } | ||
|
|
||
| /** | ||
| * 수동 로또 번호를 전달 받아 LottoTicket 객체로 반환 합니다. | ||
| * | ||
| * @param numbers 로또 번호 | ||
| * | ||
| * @return LottoTicket | ||
| */ | ||
| public LottoTicket manualGenerate(String[] numbers) { | ||
| List<Integer> lottoNumbers = Arrays.stream(numbers) | ||
| .map(Integer::parseInt) | ||
| .collect(Collectors.toList()); | ||
|
|
||
| // 유효성 체크 | ||
| LottoValidator validator = new LottoValidator(); | ||
| validator.winningNumbersValidation(lottoNumbers); | ||
|
|
||
| return new LottoTicket(lottoNumbers); | ||
| } | ||
| } |
Oops, something went wrong.
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.
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.
ㅋㅋ 줄 맞 춤 하셨군요
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.
아 이거 컨벤션 적용한건데 javadocs의 default가 저건 가봐요 ㅎㅎ
줄맞춤 안하는게 좋을까요 ? 맞춰주는게 좋아보이기도 해서요
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.
아 별뜻은 없었습니다~!
갑자기 줄을 맞추셔서 리액션..