[자동차 경주] 장종현 미션 제출합니다. #59
Open
jongchang wants to merge 12 commits into
Open
Conversation
README에 구현할 기능 목록을 정리해 추가합니다.
Console API를 사용하여 사용자의 자동차 이름 입력을 받습니다.
입력된 자동차 이름에 대한 유효성 검토 기능을 구현합니다.
Console API를 사용하여 사용자의 시도 횟수 입력을 받습니다.
입력된 시도 횟수에 대해 유효성을 검증하는 기능을 구현합니다.
자동차의 이름과 위치를 저장할 Car data class를 정의합니다.
매 시도마다의 랜덤값에 따른 Car 객체의 전진 메서드를 구현합니다.
시도 횟수만큼 경주를 실행하고 각 시도별 경주 현황을 출력하는 기능을 구현합니다.
runRace 함수 내의 자동차 이동 및 결과 출력 로직을 별도 함수로 분리합니다.
최종 우승자를 판별하고 출력하는 기능을 구현합니다.
최종 우승자를 판별하는 로직을 Kotlin 컬렉션 API를 사용하도록 리팩토링합니다.
자동차 경주에 대한 테스트 케이스를 추가합니다.
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.
자동차 경주
구현할 기능 목록
1. 자동차 이름 입력 기능
camp.nextstep.edu.missionutils.Console.readLine()을 통해 자동차 이름을 입력받기2. 입력된 자동차 이름의 유효성 검토 기능
IllegalArgumentException을 발생2. 시도 횟수 입력 기능
camp.nextstep.edu.missionutils.Console.readLine()을 통해 시도 횟수를 입력받기3. 입력된 시도 횟수의 유효성 검토 기능
IllegalArgumentException을 발생4. 자동차 객체 구현
position은 0으로 초기화5. 자동차 전진 로직 구현
camp.nextstep.edu.missionutils.Randoms.pickNumberInRange(0, 9)를 사용하여 랜덤값 추출position을 +1 증가 (전진)position을 유지 (멈춤)6. 차수별 실행 결과 출력 기능
ex) jongchang : --7. 최종 우승자 판별 및 출력 기능
position값)최종 우승자 : jongchang형식으로 출력최종 우승자 : jongchang, jomir(쉼표로 구분) 형식으로 출력