Skip to content
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

[이동현] up nd down 구현 #9

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

D5ng
Copy link

@D5ng D5ng commented Feb 1, 2025

✅ 요구사항

  • [ x ] 게임을 시작하면 컴퓨터는 1부터 50 사이의 랜덤 숫자를 생성한다.
  • [ x ] 사용자는 숫자를 추측하여 입력한다. 입력마다 "업", "다운", "정답!" 중 하나를 출력한다.
  • [ x ] 사용자의 이전 추측들을 보여준다.
  • [ x ] 사용자는 최대 5번까지 정답을 맞출 수 있으며, 5회 이내동안에는 맞출 때까지 반복한다.
  • [ x ] 게임이 끝나면 사용자가 몇 회만에 맞췄는지 출력한다.
  • [ x ] 게임을 재시작하거나 종료할 수 있는 옵션을 제공한다.

📝 구현 내용

게임을 구현함에 있어, 중복 로직 관리 및 가독성을 고려하여 코드를 작성했습니다. 나름대로 기능 요구사항을 세세하게 나눠 작업을 했지만, 여전히 복잡하다고 느껴지네요. (개인적으로 가독성이 좋다는 느낌을 받지 못했습니다)

  • 게임 룰(숫자 범위)에 벗어났을 때, 게임을 강제 종료하지 않고, 다시 시작할 수 있도록 구현했습니다.
  • 구현에 필요한 Helper 함수들을 나눠 작업하였습니다.
  • 프롬프트 메세지의 색상이 단조로워 색상을 추가해 강조해봤습니다.

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.

1 participant