-
Notifications
You must be signed in to change notification settings - Fork 55
[윤해인_BackEnd] 1주차 과제 제출합니다. #64
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
base: main
Are you sure you want to change the base?
Conversation
duehee
left a comment
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.
수고하셨습니당~
다른 버디분도 오실거에요~!!
| String[] carNames = participations.split(","); //String을 콤마를 기준으로 나누어 리스트로 변환 | ||
|
|
||
| //객체 배열 생성 | ||
| Car[] cars = new Car[carNames.length]; |
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.
carNames.length를 받는 변수를 하나 만들면 편하게 사용할 수 있을 거 같아요
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.
내장 메소드를 계속 호출하는 것보단 그게 낫겠네요!!! 수정하겠습니다!
| Game game = new Game(); | ||
| for(int i = 0; i < Counts; i++){ | ||
| System.out.println(""); | ||
| // System.out.println( "["+ (i+1) +"번째 시도]"); |
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.
사소하긴 한데, 주석 형태가 떨어져있거나, //1. || // 1. 처럼 일치하지 않아서 가독성이 떨어져 한 번 정해보면 좋을 거 같아요.
개인적으로는 // 1. 처럼 한 칸 떨어트리는 걸 선호하긴해요!
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.
신경써서 통일해보겠습니다😊
| } catch(NumberFormatException e) { | ||
| throw new IllegalArgumentException("시도 횟수는 숫자여야 합니다."); | ||
| } | ||
| if (num < 1){ |
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.
요거 이렇게 되면 1회 이상이 아니게 되지 않나요👀!!
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.
앗 1 미만은 입력하지 못하게 하려던건데 if (num == 0)이 나을까요??
| // } | ||
|
|
||
| //4 이상이면 전진 | ||
| void moveIf(int num) { if (num >= 4) { position++; } } |
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.
길이 5나, 숫자 4 같은 경우는 상단에 상수로 빼둬도 좋을 거 같아요.
코드를 읽는 사람이 의미를 한 번에 알 수 있도록 하는 것도 중요하니까요!!
private static final int MAX_NAME_LEN = 5;
private static final int MOVEABLE = 4;
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.
헉 이건 생각 못했네요 중요한 숫자는 상수를 사용해서 넣어보겠습니당..!
안녕하세요. 백엔드 비기너 윤해인입니다.
1주차 과제 - racing car 제출합니다.
예전처럼 되는대로 여러 기능을 한꺼번에 만들기 보다, 차근히 기능을 세분화하며 commit을 하니 좀 더 구조를 만들어가기 쉬웠던 것 같습니다. StringBuffer, unittest 등 처음 사용해보는 것도 있어서 여러가지 고민을 하며 구체화를 했습니다.
자세한 내용은 보고서에 작성해두었으니 많은 코멘트 해주시면 감사드리겠습니다. 2주차 교육 때 뵙겠습니다!