Skip to content

Feature/chanllange#3

Merged
Roy-wonji merged 13 commits intodevelopfrom
Feature/chanllange
Aug 29, 2025
Merged

Feature/chanllange#3
Roy-wonji merged 13 commits intodevelopfrom
Feature/chanllange

Conversation

@Roy-wonji
Copy link
Contributor

✨ 작업 내용

  • 프로그램을 시작할 때 안내문구를 보여주세요
  • 0부터 9까지 서로다른 임의의 수 3개를 랜덤으로 정한다
  • 0은 가장 앞자리에 올 수 없다
  • 정답을 맞추기위해 세자리 수를 입력하고 힌트를 받는다
  • 같은 자리에 같은 숫자가 있는 경우 스트라이크, 다른자리에 숫자가 있는 경우 볼
  • 올바르지 않은 입력값에 대해서는 오류 문구를 보여준다
  • 숫자를 정확하게 맞추면 게임이 종료된다

최대한 파일을 분리 해서 구현을 해보았습니다

Copy link

@Peter1119 Peter1119 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 !

init(digits: Int, forbidLeadingZero: Bool = true) {
precondition((1...10).contains(digits))
self.digits = digits
self.forbidLeadingZero = forbidLeadingZero

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 앞자리를 0을 받느냐 아니냐에 대한 것이죠 ??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


// MARK: - 입력 파싱
func parse(_ input: String) -> [Int]? {
let s = input.trimmingCharacters(in: .whitespacesAndNewlines)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s 보단 더 좋은 네이밍이 있을 것 같아요 !

@Peter1119 Peter1119 self-requested a review August 29, 2025 05:24
Copy link

@minneee minneee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다~

@Roy-wonji Roy-wonji merged commit 19cac7f into develop Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants