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

Jiggyjiggy #3

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

Jiggyjiggy #3

wants to merge 12 commits into from

Conversation

jiggyjiggy
Copy link

No description provided.

}
}
private void validateRange(List<Integer> input) {
if (!(input.stream().allMatch(v -> 1 <= v && v <= 9))) {
Copy link
Member

Choose a reason for hiding this comment

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

이 부분은 stream도 좋지만 정규표현식도 시도해보시면 좋을 거 같아요.

private void updateBallCount(int computerDigit, int inputDigit) {
if (computerDigit == inputDigit) {
updateNumberOfStrike();
} else {
Copy link
Member

Choose a reason for hiding this comment

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

else문 보다는 return문 사용하시면 좋을 거 같아요.

@jiggyjiggy
Copy link
Author

number class (domain) 을 두고 형식에 대한 validate 처리를 하면 좋을 것 같다.
view에서는 input에 대한 validate를 한다.

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.

2 participants