-
Notifications
You must be signed in to change notification settings - Fork 5
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
[자동차 경주] 원영진 과제 제출합니다. #5
Open
AI-WonYJ
wants to merge
16
commits into
swthewhite-lab:main
Choose a base branch
from
AI-WonYJ:AI-WonYJ
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d940bdb
feat: racingcar 초기 모델
AI-WonYJ 6777750
style: trailing-whitespace 제거
AI-WonYJ 9fe0556
style: PEP8 Style로 코드 변경
AI-WonYJ 3f62a82
style: PEP8 Style로 코드 변경
AI-WonYJ 861042a
fix: is_number()함수 기능 오류 해결
AI-WonYJ 03da6a4
refactor: 게임 실행 결과 출력 기능 분리
AI-WonYJ d85918f
refactor: Change parameter to lowercase
AI-WonYJ 0965297
fix: Add validation for empty names
AI-WonYJ 5126876
refactor: Write variable names more clearly
AI-WonYJ 094c440
refactor: Write variable names more clearly
AI-WonYJ 67c5fa0
fix: Add validation for number of attempts
AI-WonYJ e82f4d5
refactor: Change to magic number constant & PEP8 Style
AI-WonYJ 57d31a6
refactor: Change to PEP8 Style
AI-WonYJ 54e5d17
refactor: Change the validation method for entering of attempts
AI-WonYJ 7d5ff05
refactor: Separater car name input function
AI-WonYJ 48ac549
docs: Write functional documentation
AI-WonYJ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
## 기능 요구 사항 | ||
- [X] 입력 기능 | ||
- [X] 자동차 이름 입력, 5자 이하의 이름, 쉼표','로 구분분 (ex:pobi,woni,jun) | ||
- [X] 시도 횟수에 대한 입력, 양의 정수 | ||
|
||
- [X] 출력 기능 | ||
- [X] 자동차 이름 입력 요구 문구 "경주할 자동차 이름을 입력하세요.(이름은 쉼표로 구분)" | ||
- [X] 시도 횟수 입력 요구 문구 "시도할 횟수는 몇 회인가요?" | ||
- [X] 실행 결과를 이름 별로 출력 | ||
- [X] 이름 입력 순서대로 결과 표시 | ||
- [X] 이동 횟수만큼 '-' 출력하여 표현 | ||
- [X] 시도 횟수 종료 시, 최종 우승자 안내 문구 "최종 우승자 : {이름}" | ||
|
||
- [X] 게임 실행 기능 | ||
- [X] 이름별로 0~9 사이의 무작위 값 선택 | ||
- [X] 값이 4 이상이면 이동 | ||
- [X] 시도 횟수 종료 후, 이동 횟수가 가장 많은 자동차 이름이 최종 우승자 | ||
-[X] 최종 우승자는 한 명 이상 (다수 가능) | ||
|
||
- [X] 예외 처리 및 종료 기능 | ||
- [X] 사용자가 잘못된 값을 입력할 경우 ValueError를 발생 후 게임 종료 | ||
- [X] 이름 입력 시 예외 사항 | ||
- [X] 빈 이름일 경우 | ||
- [X] 중복 값이 있는 경우 | ||
- [X] 시도 횟수 입력 시 예외 사항 | ||
- [X] 양의 정수가 아닌 경우 | ||
|
||
## 기능 추가 | ||
1. name_input() | ||
> 자동차 이름 입력 기능 함수 추가 | ||
2. try_input() | ||
> 시도 횟수를 입력 기능 함수 추가 | ||
3. play_1set_of_game() | ||
> 게임 실행 기능 함수 추가 | ||
4. print_game_play_result() | ||
> 시도 횟수만큼 반복하여 게임을 실행하고 매 시도마다 실행 결과 출력 기능 함수 추가 | ||
5. check_winner() | ||
> 시도 횟수 종류 후, 이동 횟수가 가장 많은 최종 우승자를 찾는 기능 함수 추가 | ||
6. validate_input() | ||
> 잘못된 값을 입력한 경우 ValueError가 발생하여 프로그램을 종료하는 기능 함수 추가 | ||
7. is_number() | ||
> 시도 횟수 입력 값이 int형인지 검증하는 기능 함수 추가 | ||
|
||
## 오류 수정 | ||
1. is_number() 수정 | ||
> str형 검증으로 작동하던 오류를 int형 검증으로 수정 | ||
>> ~~str~~int(data) | ||
|
||
## 기능 수정 | ||
1. validate_name() | ||
> 이름 입력 값을 검증(이름 길이, null값, 중복) 기능을 validate_input()으로부터 함수 분리 |
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
메인 함수에 예외 처리를 추가하고 문자열 포맷팅을 개선해주세요.
📝 Committable suggestion