Skip to content

Week1#1

Open
piamin04 wants to merge 2 commits into
developfrom
week1
Open

Week1#1
piamin04 wants to merge 2 commits into
developfrom
week1

Conversation

@piamin04

@piamin04 piamin04 commented Feb 3, 2025

Copy link
Copy Markdown
Owner

No description provided.

@piamin04 piamin04 self-assigned this Feb 3, 2025

@moongua404 moongua404 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

시간이 부족했을텐데 lean하게(?) 기능을 구현하신 것 같아요!
1주차 미션 수고많으셨습니다

Comment thread src/main/java/calculator/Application.java
for(int i=1;i<delimiters.length;i++){
delimiterRegex+="|";
delimiterRegex+=delimiters[i];
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

join인가 그거 쓰면 간단히 해결될 수 있을 것 같아요

for(int j=0;j<numberslenth;j++){
int real =Integer.parseInt(numbers[j]);
sum+=real;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

인덱스 접근으로 할 필요가 있을까요? 원소를 순회하는 방식으로 하는게 더 좋을 것 같아요!

System.out.println("sum = "+sum);
}
}
} No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

주석을 단 부분들을 함수로 빼면 좀 더 가독성이 좋을 것 같아요!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

동의합니다.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

동의합니다

String newdelimiter="";
int newdelimitersize=0;
if(input.startsWith("//")){
int customendIndex=input.indexOf("\\n");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

인덱스로 접근하는 방식이 가독성이 떨어지는 것 같아요

@BYEONGHWALEE-dev

Copy link
Copy Markdown

고생 많으셨습니다.

@KIM-GOING KIM-GOING left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

자바라는 언어가 프로그래밍되는 스타일이 어떤지 공부하며 코드를 작성하면 더욱 도움이 될 수 있을 거 같습니다. 수고하셨습니다:)

System.out.println("sum = "+sum);
}
}
} No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

동의합니다

// -> 얘는 밑에 코드를 while문안에 넣어놓고 조건을 문장의 첫 부분이 \가 아닐때까지로 하면되지않을까..?
//그냥 커스텀 구분자는 입력 하나에 하나만 있다고 해야지...ㅎㅅㅎ
String newdelimiter="";
int newdelimitersize=0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

newdelimitersize는 없어도 될 것 같아용

// -> 얘는 밑에 코드를 while문안에 넣어놓고 조건을 문장의 첫 부분이 \가 아닐때까지로 하면되지않을까..?
//그냥 커스텀 구분자는 입력 하나에 하나만 있다고 해야지...ㅎㅅㅎ
String newdelimiter="";
int newdelimitersize=0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

변수명 지을때 newDelimiterSize 처럼 원래 띄어쓰기 해야되는 부분을 대문자로 표기하는 카멜케이스를 적용하면 더 좋을 것 같습니다

throw new IllegalArgumentException("Error");
}
newdelimiter = input.substring(2, customendIndex); // "//" 이후와 "\n" 사이 추출
String[] newDelimiters = new String[delimiters.length + 1]; //배열 복사를 위한 새로운 배열 생성

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

newdelimiter와 newDelimiters 가 이름이 비슷해서 헷갈릴 것 같아요

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.

5 participants