Code Monkey home page Code Monkey logo

bowling's Introduction

Install

requirement

install Node latest version here

go to downloaded folder

# init project using npm
$ npm install

# or
# init project by yarn
$ yarn

How to run

$ yarn dev

Optional requirement:

Have optional requirement included.

if time permits implement the rules for the last frame (i.e, 10th frame)

In the last frame, if the bowler bowls a spare, they get another bowl. The score of this frame is the sum of the three bowls. In the last frame, if the bowler bowls a strike, they get another 2 bowls. The score of this frame is the sum of the three bowls If one has a strike for every roll, their score is 300i

Assumption

  • it won't have any invalid input, which means it will always has a vaild frame, for example it won't in half of one frame or end with only 9 frames.
  • getScore function won't be called if a game not finished yet.
  • all input roll should be valid until it finished and you should always have 10 frames and sometimes might be 11 or 12 frames, but code dont have this concern done in logic.

Concerns

  • according to requirement, it is not describe if get score can be in the middle of a frame which is not done yet or not. if it is yes, it would be more complex because current score is not accurated. especially with the optional requirement. for example: if user in 10 | 4 right now, should application can be called getScore or not?

  • according to cli, user can only type every roll they did, so it might be not clear for user understand when to finish in a round

Highlights

  • Optional part done
  • input validate
  • Partialy fix concers above but not sure if is reasonable or not because im not really play bowling. can get score in any roll
  • max roll protection as 12 as max according to optional part

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.