-
Notifications
You must be signed in to change notification settings - Fork 117
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
[자동차 경주] 김지원 미션 제출합니다. #113
Open
kimgwon
wants to merge
24
commits into
woowacourse-precourse:main
Choose a base branch
from
kimgwon:main
base: main
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.
Open
Conversation
This file contains 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
- Implemented readLine() to receive input from the user
- Implemented carNames() to receive car names from user
- Changed the visibility of readLine() function to private for encapsulation
- Implemented raceCount() to receive race count from the user
- Implemented getCarNames() to check the length of car name (1 to 5 characters) - Implemented getRaceCount() to validate if the input is a number
…ound() - Changed function name to better reflect the purpose of counting rounds in each race
- Changed function name to better reflect the purpose of counting rounds in each race - Aligned with InputController's getRaceRound() method for consistency
- Implemented move() to moving + 1 when value >= 4
- Added cars property to manage a list of Car objects
- Required cars property for starting race
- Called Car.move() with random value (1~9)
- Implemented logic to find the Car with the maximum moving value
…splay results - Added start logic to prompt user input for cars and rounds - Implemented race with round results and final winner display
…troller - Moved car name and race round validation logic to InputValidation - Removed InputController and updated Input class accordingly
…nject dependencies - Extracted input, output to the main() in Application class
- Added addCars() method to handle car list - Moved maxMoving() method in Race class
- Moved constants for better organization - Updated relevant classes to use the extracted constants
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.
kotlin-racingcar-precourse
기능 요구 사항
사용자 입력
camp.nextstep.edu.missionutils.Console
의readLine()
을 이용한다.출력
자동차: Car
name(이름)
,moving(이동 칸)
을 변수로 가지고 있다.자동차 이동: Car - move()
자동차 경주: Race
cars: List<Car>
를 변수로 갖는다.우승자 결정: Race - getWinner()
자동차 생성: CarController - makeCar()
cars
로 만든다.자동차 이동: CarController - moveCar()
camp.nextstep.edu.missionutils.Randoms
의pickNumberInRange()
로 나온 값을 Car-move()로 호출한다.