Open
Conversation
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.
과제 설명
작업 사항
validateCarNames(): 입력된 자동차 이름을 검증하는 함수로, 이름의 길이가 1자 이상 5자 이하인지, 2개 이상의 이름이 입력되었는지 확인하고 유효하지 않은 경우 오류를 발생시킨다.initializeCarPositions(): 자동차 이름 배열을 받아 각 자동차의 위치를 0으로 초기화한다.runRace(): 사용자로부터 입력받은 시도 횟수만큼 반복하여 경주를 진행하고, 각 턴에서 모든 자동차의 이동 여부를 결정하고 이동 결과를 출력한다.moveCar(): 무작위 값이 4 이상일 때 자동차의 위치를 증가시킨다.showCarPosition(): 현재 자동차의 위치를 “-“로 표시하여 출력한다.getWinners(): 모든 시도가 끝난 후 가장 멀리 이동한 자동차를 우승자로 판별하여 우승자 목록을 반환한다.참고 사항