Skip to content

원지웅_BackEnd 2주차 Race 과제 제출#1

Open
dnjswldnd-3513 wants to merge 16 commits intoBCSDLab-Edu:mainfrom
dnjswldnd-3513:main
Open

원지웅_BackEnd 2주차 Race 과제 제출#1
dnjswldnd-3513 wants to merge 16 commits intoBCSDLab-Edu:mainfrom
dnjswldnd-3513:main

Conversation

@dnjswldnd-3513
Copy link
Copy Markdown

스크린샷 2026-03-24 오후 9 02 00

Test 확인 완료했고 안에 터미널에 뜨는 빨간색 글자는 원래 뜨는건지 확인받고 싶습니다!

Copy link
Copy Markdown
Collaborator

@dh2906 dh2906 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!
OOP에 대한 리뷰는 제외하고 컨벤션, 코드 스타일, 의도 등에 대해서만 리뷰 남겨드렸습니다~!!

if (race_Count <= 0){
throw new IllegalArgumentException();
}
raceStart();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

raceStart() 메소드는 initRace() 내부에 둔 이유가 있으신가요??

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

아까 그 'raceList()' 부분에서 말씀드린것처럼
에러가 발생시 원래 바로잡고 다시 프로그램을 실행시킬려고 했기 때문에 다시 초기화가 되어야 하기에 이런식으로 작성했습니다.
사실 현 상황에서는 상관 없는 코드이지만 그래도 실행할때 문제가 없어서 그대로 내버려두었습니다

Comment on lines +64 to +69
String final_victory = carList.stream()
.sorted((e1,e2) -> Integer.compare(e2.getStack(),e1.getStack()))
.filter(f -> f.getStack() == maxStack)
.map(Car::getName).collect(Collectors.joining(", "));

System.out.println("최종 우승자 : " + final_victory);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

레이싱 경주를 시작하는 로직이랑 우승자를 구하는 로직은 하나의 메소드에 있어야 할까요??

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

처음에는 마지막 race가 종료되는 부분에 기능을 두 개로 분리하는걸 생각했으나 코드 짜는 과정에서 'initCar()','initRace()','initStart()'같이 역할이 명확하게 나눠지는 구조가 가독성과 흐름 면에서 괜찮을거 같다고 생각했습니다.
메서드 분리 기준에 대해 더 좋은 생각이 있으시다면 적극적으로 반영하겠습니다!!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

깃허브 알림이 꺼져있어서 늦게 확인한점 양해부탁드려욥

@dnjswldnd-3513 dnjswldnd-3513 changed the title 원지웅_BackEnd 1주차 Race 과제 제출 원지웅_BackEnd 2주차 Race 과제 제출 Mar 31, 2026
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