GithubHelp home page GithubHelp logo

java-racingcar's Introduction

우아한 테크코스 온라인 2주차

자동차 경주 게임

문제 설명

  • 주어진 횟수 동안 n대의 자동차는 전진 또는 멈출 수 있다.
  • 각 자동차에 이름을 부여할 수 있다. 전진하는 자동차를 출력할 때 자동차 이름을 같이 출력한다.
  • 자동차 이름은 쉼표(,)를 기준으로 구분하며 이름은 5자 이하만 가능하다.
  • 사용자는 몇 번의 이동을 할 것인지를 입력할 수 있어야 한다.
  • 전진하는 조건은 0에서 9 사이에서 random 값을 구한 후 random 값이 4 이상일 경우 전진하고, 3 이하의 값이면 멈춘다.
  • 자동차 경주 게임을 완료한 후 누가 우승했는지를 알려준다. 우승자는 한 명 이상일 수 있다.

구현할 기능

  • Car 클래스

    • 자동차 이름 getter
      • getName()
    • 자동차 위치 getter
      • getPosition()
    • 자동차 이동
      • tryRide()
    • 자동차가 전진하는지 안하는지 확인
      • checkRide()
  • Race 클래스

    • 게임 실행
      • playGame()
    • 경주할 자동차들의 초기설정
      • initCar()
    • 레이스 실행
      • doRace()
    • 이름 조건 확인
      • isNameValid()
    • 실행 결과 append
      • makeResult()
    • 실행 결과 리턴
      • printResult()
    • 자동차 위치를 문자열로 바꿈
      • positionToResult()
    • 우승자 가리기
      • getWinner()
  • Main 클래스

    • 프로그램 실행
      • main()

java-racingcar's People

Contributors

dasisthyojin avatar pobiconan avatar

Watchers

James Cloos 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.