Skip to content
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

[자동차 경주] 남인우 미션 제출합니다. #2374

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

korean5078
Copy link

No description provided.

1. RacingCar 클래스 생성
2. 0부터 9까지 랜덤 값을 구하는 함수 makeRandomNumber 구현
1. RacingCar의 randomNumber가 4이상인 경우 전진하는 함수 goOrStop 구현
1. RacingCar 클래스에서 생성자를 통해 이름을 부여할 수 있는 기능 이미 구현됨
1. Player 클래스 생성
2. 각 자동차에 부여할 이름을 입력하는 inputNames 함수 구현
3. 이름이 5자 이상 입력되면 예외 발생하는 함수 validateName 함수 구현
4. 기능 명세서 수정
1. 자동차들의 이동 횟수를 입력하는 inputNumberOfRounds 함수 구현
2. 기능 명세서 수정
1. 플레이어에게 이름을 입력 받으면 자동차 객체들을 해당 개수만큼 생성하는 함수 createRacingCars 함수 구현
1. RacingCarGame 클래스에서 라운드마다 자동차가 전진 또는 멈추는 roundStart 함수 구현
2. RacicngCar 클래스에서 이름과 거리를 출력하는 printDistance 함수 구현
3. RacingCarGame 클래스에서 라운드마다 각 자동차의 이름과 거리를 출력하는 printRoundScore 함수 구현
4. RacingCarGame 클래스에서 전체적인 게임을 실행하는 init 함수 구현
1. RacingCarGame 클래스에서 최종 라운드에서 거리가 가장 긴 자동차를 찾는 함수 chooseWinner 구현
2. RacingCarGame 클래스에서 우승한 자동차의 이름을 출력하는 함수 printWinnerName 구현
3. RacingCar 클래스에서 이름을 반환하는 gettter 함수 추가
1. chooseWinner 함수가 한 가지 일만 하도록 가장 높은 거리 값을 구하는 기능을 getHighestDistance 함수로 이동
1. makeRandomNumber 함수 접근 제한자를 private로 수정
2. goOrStop 함수에서 makeRandomNumber 함수 실행
1. 끝에 ','가 있으면 예외를 발생시키는 함수 validateLine 구현 및 inputNames 함수에 적용
2. 예외를 발생시키는 함수마다 예외를 던지게끔 코드 수정
1. init 함수에서 게임 라운드 마다 반복하는 코드를 startGameRounds 함수를 새로 만들어서 분리
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant