Merged
Conversation
Peter1119
approved these changes
Aug 28, 2025
| trimmed.allSatisfy({ $0.isNumber }), | ||
| !trimmed.contains("0") else { return nil } | ||
| let numbers = trimmed.compactMap { Int(String($0)) } | ||
| guard Set(numbers).count == digits else { return nil } |
Contributor
Author
There was a problem hiding this comment.
@Peter1119 중복된 값을 안들어오게 할려고 해서여 그렇게 진행을 했습니다
Comment on lines
+60
to
+65
| let strikeCount = zip(answer, guess).filter { $0 == $1 }.count | ||
| let ballCount = guess.filter { answer.contains($0) }.count - strikeCount | ||
|
|
||
| if strikeCount == digits { return .correct } | ||
| if strikeCount == 0 && ballCount == 0 { return .nothing } | ||
| return .strikeAndBall(strike: strikeCount, ball: ballCount) |
There was a problem hiding this comment.
answer과 guess에 대한 파라미터로 들어오고
둘의 관계가 더 중요해보입니다. 따라서 digits의 의존성을 제거하는 것도 좋을 것 같아요 ~!
digits로 인해서 answer의 count가 결정된다는 것을 한번 더 생각하게 되는 방향이라서요 ~!
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.
✨ 작업 내용