GithubHelp home page GithubHelp logo

tdd-lotto's Introduction

TDD Lotto

TDD를 통해 Lotto game 구현하기

기능 요구사항

  • 구입 금액을 입력하면, 금액만큼 로또를 구매할 수 있다.
    • 로또 한 장의 가격은 1000원이다.
    • 입력 금액은 1000원 이상이어야 한다.
    • 1000원 단위가 아닌 금액은 버린다. (1500원 -> 1장만 구매 가능)
    • 각 로또는 6개의 번호로 이루어진다.
    • 6개의 숫자는 1에서 45사이이다.
    • 6개의 숫자는 중복될 수 없다.
  • 지난주 당첨 번호를 입력할 수 있다.
    • 당첨 번호는 6자리 숫자를 입력해야 한다. (에러 발생)
    • 각 숫자는 1에서 45 사이이다. (에러 발생)
    • 각 숫자는 중복될 수 없다. (에러 발생)
  • 보너스 번호를 입력할 수 있다.
    • 숫자 하나를 입력해야 한다. (에러 발생)
    • 숫자는 1에서 45사이이다. (에러 발생)
    • 당첨 번호에 포함되지 않은 번호여야 한다. (에러 발생)
  • 당첨 번호와 보너스 번호를 이용해 로또가 몇 등인지 알 수 있다.
  • 당첨 번호와 보너스 번호를 입력하면 로또 목록의 당첨 통계를 확인할 수 있다.
  • 전체 구매액수 대비 당첨금 수익률을 계산할 수 있다.

참고

로또 당첨 금액은 고정되어 있다.

등수 기준 금액
1등 6개숫자 일치 2,000,000,000
2등 5개숫자 일치 + 보너스 30,000,000
3등 5개숫자 일치 1,500,000
4등 4개숫자 일치 50,000
5등 3개숫자 일치 5,000

tdd-lotto's People

Contributors

nillk avatar

Watchers

 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.