Conversation
1. 버전을 입력하는 기능 구현 2. 입력타입이 맞지 않을경우 예외처리 구현
1. 랜덤으로 숫자를 뽑는 기능 추가 2. 올바르지 않은 타입의 입력일 때 예외를 출력
1. 랜덤 알파벳을 뽑고 사용자의 입력과 일치한지 확인하는 기능 추가 2. 사용자의 입력에 따라 입력 문구 변경하는 기능 추가
1. 출력범위가 정상적으로 출력되도록 수정 2. 범위를 관리하는 range 클래스 분리
1. 영어버전에서 소문자가 범위에 포함되지 않은 현상 수정 2. 영어버전 range 클래스 분리
1. 예외 처리 함수의 방식을 예외 던지기로 변경 2. 숫자 범위를 range 클래스에서 데이터를 가져오는 대신 isInRange 함수를 사용하도록 변경
1. 입력시 예외처리에 대한 테스크코드 작성 2. 알파벳 두개 입력 예외처리에 대한 테스트코드 작성
huncozyboy
reviewed
Apr 18, 2024
Comment on lines
+78
to
+82
| public void validCharLength(String s) { | ||
| if (s.length() >= 2) { | ||
| throw new IllegalArgumentException("[ERROR] 알파벳 한 글자만 입력해주세요 "); | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
알파벳을 여러개를 입력하는 예외처리는 생각못했는데 좋은거 같습니다!
ay-eonii
reviewed
Apr 18, 2024
| double randomValue = Math.random(); | ||
| int randomNumber = (int)(randomValue *100) +1; | ||
| int cnt = 0; | ||
| int correct = -1; |
Member
There was a problem hiding this comment.
correct를 -1로 둔 이유가 무엇인가요?
의도를 파악하기 힘든 것 같아요
Member
Author
There was a problem hiding this comment.
correct는 정답이라는 의미의 변수입니다.
1로 두었다가 한번에 정답이 되는 현상을 방지하기 위함이었습니다!
| int cnt = 0; | ||
| int correct = -1; | ||
| Range range = new Range(1, 100); | ||
| while (correct != randomNumber) { |
Member
Author
There was a problem hiding this comment.
contoller 에서 분리하려고 하는데 새로운 클래스를 만들어서 따로 검증하는 것이 더 좋은 방향일까요?
Comment on lines
+20
to
+26
| public void setMin(char min) { | ||
| this.min = min; | ||
| } | ||
|
|
||
| public void setMax(char max) { | ||
| this.max = max; | ||
| } |
Comment on lines
+28
to
+30
| public boolean isInRange(char value) { | ||
| return value >= min && value <= max; | ||
| } |
jj0526
reviewed
Apr 18, 2024
| range.setMin((char)(correct + 1)); | ||
| } else if (correct > randomAlpha) { | ||
| System.out.println("DOWN"); | ||
| range.setMax((char)(correct - 1)); |
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.
미션 실행 결과
기능 명세서
InputView
Contoller
회고
이에 관련하여 피드백 해주시면 좋겠습니다