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

car game 구현 #9

Open
wants to merge 4 commits into
base: splguyjr
Choose a base branch
from
Open

car game 구현 #9

wants to merge 4 commits into from

Conversation

splguyjr
Copy link

No description provided.

Copy link
Collaborator

@rohsik2 rohsik2 left a comment

Choose a reason for hiding this comment

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

동작하는 코드를 작성하신것부터 이미 첫 걸음을 넘어신겁니다! 코드를 서로다른 메소드로 분리해보세요!

while(!validInput) {
try {
System.out.println("시도할 회수는 몇회인가요?");
attempt = scanner.nextInt();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Scanner 대신 console.readLine() -> Integer.parseInt 라는 함수로 파싱을 해서 사용하실 수 있습니다!

Copy link

@nahyun0121 nahyun0121 left a comment

Choose a reason for hiding this comment

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

저처럼 자바에 익숙치 않으신 것 같은데 직접 다 구현해보려고 하신 것 같아서 대단해요! 저는 제 머릿속에 그린 구조와 가장 비슷하게 구현했던 분의 코드를 참고하여 구현했는데 이렇게 하면서 모르는 부분 공부하는 것도 단기간에 도움이 되었습니다:)


String input = Console.readLine();

String[] car_name = input.split(",");

Choose a reason for hiding this comment

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

시도 횟수를 입력 받을 때 예외 처리를 잘 해주셨는데, 여기서 자동차 이름들을 입력받을 때도 조건이었던 5글자인지 확인하고 예외 처리하는 부분도 추가하면 더 좋을 것 같습니다!

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