Open
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.
게임 진행 횟수와 관련해서 최솟값 제한을 둔 부분이 인상 깊습니다!
다만, 최대 값에 대해서는 제한을 하지 않아도 될 것 같은데 제한 하셨다는 점에서 의문이 있습니다. 혹시 특별한 이유가 있으셨을까요?
|
|
||
| OutputView.printRaceHeader(); | ||
| for (let i = 0; i < attemptCount; i++) { | ||
| raceGame.runSingleAttempt(); |
There was a problem hiding this comment.
입력된 횟수만큼 라운드를 진행하는 로직을 한 번에 처리하지 않으시고 따로 왜runSingleAttempt로 별도의 메소드를 두시고 여러번 호출하셨는지 궁금합니다! 걸리는 시간은 비슷할 것 같은데 특별한 이유가 있으셨는지 궁금합니다.
| MIN_ATTEMPT: 1, | ||
|
|
||
| PROGRESS_VISUAL: "-", | ||
| VISUAL_SPACE: "", |
There was a problem hiding this comment.
이 VISUAL_SPACE는 무슨 역할을 하는 상수인가요? 필요한 상수로는 보이지 않는데, 선언하신 이유가 궁금합니다!
|
코드 컨벤션이 잘 갖춰져서 그런지 코드가 깔끔했고, 상수처리를 자세하게 해두신 점이 인상깊었습니다! 흐름이 눈에 잘 들어와서 이해하기도 편했습니다. 코드 잘 봤습니다! 3주차 미션도 파이팅 하세요~ |
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.
No description provided.