Giter Site home page Giter Site logo

kotlin-racingcar's Introduction

kotlin-racingcar

초간단 자동차 경주 게임

  1. 각 자동차에 이름을 부여합니다. 자동차 이름은 5자를 초과할 수 없습니다.

  2. 전진하는 자동차를 출력할 때에는 이름을 같이 출력합니다.

  3. 자동차 이름은 쉼표(,)를 기준으로 구분합니다.

  4. 자동차 경주 게임을 완료한 후 누가 우승했는지를 알려줍니다. 우승자는 한 명 이상일 수 있습니다.

경주할 자동차 이름을 입력하세요(이름은 쉼표(,)를 기준으로 구분).
pobi,crong,honux
시도할 횟수는 몇 회인가요?
5

실행 결과
pobi : -
crong : -
honux : -

pobi : --
crong : -
honux : --

pobi : ---
crong : --
honux : ---

pobi : ----
crong : ---
honux : ----

pobi : -----
crong : ----
honux : -----

pobi, honux가 최종 우승했습니다.

사전 구현 계획

  • 위치 - Position

  • 자동차 - Car

  • 자동차의 이동 정책 - MovementPolicy

  • 자동차들의 상태들을 관리 - RacingCarRoad

  • 우승자를 결정하는 정책 - RankingPolicy

  • 자동차에 이름을 부여할 수 있고 이름은 5자를 초과할 수 없다.

  • UI 로직: 자동차 이름은 쉼표로 구분한다.

  • 들여쓰기가 3 이상인 경우가 있다면 리펙토링한다.

  • Car 객체의 함수명 변경, 제약 조건 상수화

  • RacingCarRoad에 해당하는 에러 메세지는 RacingCarRoad가 관리한다.

  • List<Car>를 래핑한 일급 컬렉션을 사용한다.

    • RacingCarRoad의 함수명에서 getXXX 형식을 버린다.
  • 사용하지 않는 함수는 삭제

kotlin-racingcar's People

Contributors

wotjd243 avatar yibeomseok avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.