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

[자동차 경주 게임] 김민수 미션 제출합니다. #211

Open
wants to merge 34 commits into
base: main
Choose a base branch
from

Conversation

alstn113
Copy link

  1. 자동차 클래스 및 자동차 목록 생성

    • 자동차 클래스 설계: 자동차의 이름, 전진 여부를 관리하는 메서드와 속성
    • 여러 대의 자동차를 관리하는 자동차 목록 생성
    • 자동차 이름은 5자 이하만 가능하며, 쉼표(,)로 구분하여 입력 받기
  2. 무작위 값으로 전진 여부 판단

    • Randoms 라이브러리를 활용해 0에서 9까지의 무작위 값을 생성
    • 생성된 값이 4 이상일 경우 자동차가 전진하는 조건 설정
  3. 이동 횟수 입력 및 실행

    • 사용자로부터 이동을 시도할 횟수 입력 받기
    • 이동 횟수에 따라 각 자동차의 전진 여부 결정
    • 전진한 자동차의 상태 출력
  4. 우승자 결정

    • 모든 이동이 끝난 후, 우승한 자동차(들)을 결정
    • 우승자가 한 명인 경우 해당 우승자 출력
    • 우승자가 여러 명일 경우 쉼표(,)로 구분하여 출력
  5. 예외 처리

    • 사용자 입력에 대한 예외 처리: 잘못된 값 또는 형식 입력 시 IllegalArgumentException 발생 및 처리
    • 잘못된 값이 입력되었을 때 프로그램 종료

Domain

  • NumberGenerator inteface, RandomNumberGenerator
  • RaceAttempts 시도 횟수, 일급 컬렉션, 자연수 아닌 값 예외 처리
  • RaceParticipants - 일급 컬렉션, 이름 구분자 처리,이름 중복 예외 처리
  • RaceWinners - 경기 우승자(들), 일급 컬렉션
  • RacingCar 레이싱 카, 이름 길이 예외 처리

View

  • InputView - 입력
  • OutputView - 출력
  • racingcar.view.console.util.InputUtil 일반적인 입력 예외 처리

Controller

  • RacingController - 레이싱 게임 진행

Exception

  • BaseException - 기본 예외 처리
  • InvalidInputException - 입력 예외 처리
  • ErrorMessage - 에러 메시지 상수화

Copy link

@junhyeongkim2 junhyeongkim2 left a comment

Choose a reason for hiding this comment

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

안녕하세요! 코드 리뷰 남기고 갑니다! 감사합니다.

Copy link

@cosyflower cosyflower left a comment

Choose a reason for hiding this comment

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

@alstn113 님! 코드 잘 읽고 가요
Exception을 다시 분류해서 작성하신 모습을 보면서 예외를 더 깔끔하게 작성할 수 있는 방법을 알아갈 수 있었어요! 테스트 코드에서도 nested,, 저도 다음 미션 때 참고하겠습니다

2주 차 미션 고생 많으셨어요:)

Copy link

@songjayhyun songjayhyun left a comment

Choose a reason for hiding this comment

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

2주차도 고생하셨습니다.

전체적으로 코드가 깔끔하고 많이 배워가네요 ㅎㅎ 클래스 활용과 exception 처리 부분은 다음 미션때 활용해봐야 겠습니다 !!

저도 리뷰 부탁드릴게요 ! #1170

Copy link

@TaeHye0n TaeHye0n left a comment

Choose a reason for hiding this comment

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

코드 잘 봤습니다.
전체적으로 많은 고민을 하셨다는게 느껴지네요.
특히 getter를 지양한 점과 Randoms를 사용할 때 인터페이스를 구현하는 방법이 인상 깊었습니다.

궁금한점은 View의 메서드들을 Static으로 선언하면 인스턴스화 할 필요 없이 컨트롤러에서 사용할 수 있어 Static으로 저는 사용했었는데, 민수님은 어떤 방법이 더 좋다고 생각하시는지 궁금합니다.

@alstn113
Copy link
Author

alstn113 commented Nov 2, 2023

@TaeHye0n
input이나 output을 인터페이스로 만들고 갈아끼운다면 파라미터에 넣는게 좋다고 생각합니다.

Copy link

@dy102 dy102 left a comment

Choose a reason for hiding this comment

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

구조도 좋고, 인터페이스 사용하신 부분도 좋아요. 그리고 구조를 많이 나눈 것에 비해 코드가 읽기 어렵지 않았어요. 전반적으로 좋아보여요

Copy link

@JudyYeon JudyYeon left a comment

Choose a reason for hiding this comment

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

고생하셨습니다😆

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.

None yet