Open
Conversation
543c1a2 to
7a221c3
Compare
ssilver01
reviewed
Nov 6, 2024
ssilver01
left a comment
There was a problem hiding this comment.
LGTM
코드를 금방 구현하셨다고 들었는데 깔끔히 잘 한 것 같아요 !
다만 LottoVendingMachine에 너무 많은 로직이 들어가 있는 것 같아 이 부분만 분리를 하면 더 좋을 것 같습니다 ! 수고하셨습니다
| if (Number(number) < 1000) { | ||
| throw new Error(MESSAGES.ERROR.PREFIX + MESSAGES.ERROR.SMALL_INT); | ||
| } | ||
| if (number.slice(-3) !== "000") { |
There was a problem hiding this comment.
방법은 되게 새로웠는데 로또 가격이 1000원이 아닐 경우 경우의 수가 많아지기 때문에 좋은 방법인진 모르네요..🤔
1000원 이외의 금액으로 바뀌었을 때 좋은 방법인지 고민해봐야될 것 같아요 ! 혹시 방법이 따로 있을까요?
Author
There was a problem hiding this comment.
그렇네요 이것도 일종의 매직 넘버처럼 보일 수 있어서 로또 금액을 상수화 한 다음에 불러와서 사용하는 것이 추후 확장성을 생각하면 저도 더 좋아 보여요!
Comment on lines
8
to
+9
| this.#validate(numbers); | ||
| this.#validateDuplicate(numbers); |
There was a problem hiding this comment.
validate안에 validateIntsRange 는 validate안에 넣었는데 validateDuplicate를 따로 하신 이유가 있을까요?!
Author
There was a problem hiding this comment.
- validateIntsRange()는 number 배열이 아니라 파라미터로 하나의 숫자를 받아 검증하도록 해서였습니다
- 원랜 같이 넣으려다가 너무 함수가 길어져서 뺐습니다.
- 차라리 validate들을 더 분리하고 생성자에서 다 불러오는 것이 가독성 측면에서 더 좋아 보였는데 시간이 없었네요 :)
Comment on lines
+136
to
+137
| Console.print(""); | ||
| Console.print(MESSAGES.OUTPUT.WIN_RATE); |
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.
javascript-lotto-precourse
기능 목록 - turtlehwan
중점 사항