Skip to content

Conversation

@amaran-th
Copy link

버전 설정이 잘못되어있었어서 1시간은 삽질한 것 같네요...
코드 작성하는 난이도는 제약조건까지 준수했을 때 숫자야구게임이랑 비슷한 것 같습니다.

@shkisme shkisme self-requested a review November 9, 2022 03:18
@shkisme
Copy link
Contributor

shkisme commented Nov 9, 2022

빠르다 ... ! 👍
얼른 시간 내어 리뷰 작성하겠습니다!

Copy link
Contributor

@shkisme shkisme left a comment

Choose a reason for hiding this comment

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

리뷰 확인 해주세요 😎

public class Application {

public static void main(String[] args) {
GameController gameController = new GameController();
Copy link
Contributor

Choose a reason for hiding this comment

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

mainGameController 클래스를 생성하고, 게임을 시작하는 역할만 하도록 잘 작성하신 것 같습니다! 👍

public class RacingTool {
public static boolean isGoAhead(){ //전진할 지 여부를 반환하는 메서드
int random= Randoms.pickNumberInRange(0, 9);
return random>=4;
Copy link
Contributor

Choose a reason for hiding this comment

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

여기 포메터 적용이 안 된 것 같아요! ㅎㅎ

import java.util.List;
import racingcar.Car;

public class TextPrinter {
Copy link
Contributor

Choose a reason for hiding this comment

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

TextPrinter 클래스는 출력만 하도록 역할을 잘 분리하신 것 같아요👍👍 그런데 TextPrinter 클래스의 메서드들을 정적 메서드들로 설정하신 이유가 있나요?

}

public int getMaxPosition() {
int max = 0, pos;
Copy link
Contributor

@shkisme shkisme Nov 11, 2022

Choose a reason for hiding this comment

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

저는 요새 stream 사용 연습에 몰두하는 중입니다! 스트림으로 표현했을 때 훨씬 간결해질 것 같은 메서드들이 GameController 에 많은 것 같아요! 예를 들어 getMaxPosition 메서드는 아래처럼 나타낼 수 있을 것 같습니다.

return carList.stream().map(Car::getPosition).reduce(Integer::max).get();

진짜 마법같지 않나요 ?! 이번 기회에 스트림을 활용해서 메서드들을 리팩토링 해보는 것도 좋을 것 같습니다!

Copy link

Choose a reason for hiding this comment

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

amaran-th added 2 commits November 20, 2022 16:01
- RacingTool.java 포매터 적용
- TextPrinter, TextScanner 클래스 non-static 메서드로 변경
- for문 몇몇을 stream으로 구현
@amaran-th amaran-th requested a review from shkisme November 20, 2022 07:27
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.

4 participants