-
Notifications
You must be signed in to change notification settings - Fork 212
[자동차 경주] 김용주 미션 제출합니다. #197
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
base: main
Are you sure you want to change the base?
Conversation
- Replace math.random() with MissionUtils.pickNumberInRange in the game progress function
…ectively - 함수 단위로 분리하여 선언적으로 함수를 진행하고, JS 문법을 더 활용하여 알고리즘을 수정했다.
- car 클래스를 새 파일에 분리 - car 클래스 내부에 추가 내장 메서드 추가 - move : 전진 여부 판정 기능 - progressToHyphens : car 객체의 progress 값 만큼 '-' 기호를 추가한 문자열을 반환 - printProgress : 전진도 만큼의 '-'기호를 출력하는 기능
… a separate file for clearer responsibility
- validateCarNames : 자동차 이름에 관해 중복과 길이에 관한 유효성검사를 도메인 코드 내부에서 관리하도록 작성 이는 입력 형식과 입력값의 유효성 검사를 분리하여 RacingGame 클래스에 작성한거다
|
|
||
| MAX_ATTEMPT: 5, | ||
| MIN_ATTEMPT: 1, | ||
|
|
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.
게임 진행 횟수와 관련해서 최솟값 제한을 둔 부분이 인상 깊습니다!
다만, 최대 값에 대해서는 제한을 하지 않아도 될 것 같은데 제한 하셨다는 점에서 의문이 있습니다. 혹시 특별한 이유가 있으셨을까요?
|
|
||
| OutputView.printRaceHeader(); | ||
| for (let i = 0; i < attemptCount; i++) { | ||
| raceGame.runSingleAttempt(); |
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.
입력된 횟수만큼 라운드를 진행하는 로직을 한 번에 처리하지 않으시고 따로 왜runSingleAttempt로 별도의 메소드를 두시고 여러번 호출하셨는지 궁금합니다! 걸리는 시간은 비슷할 것 같은데 특별한 이유가 있으셨는지 궁금합니다.
| MIN_ATTEMPT: 1, | ||
|
|
||
| PROGRESS_VISUAL: "-", | ||
| VISUAL_SPACE: "", |
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.
이 VISUAL_SPACE는 무슨 역할을 하는 상수인가요? 필요한 상수로는 보이지 않는데, 선언하신 이유가 궁금합니다!
|
코드 컨벤션이 잘 갖춰져서 그런지 코드가 깔끔했고, 상수처리를 자세하게 해두신 점이 인상깊었습니다! 흐름이 눈에 잘 들어와서 이해하기도 편했습니다. 코드 잘 봤습니다! 3주차 미션도 파이팅 하세요~ |
No description provided.