GithubHelp home page GithubHelp logo

abrahamoshel / bowling Goto Github PK

View Code? Open in Web Editor NEW

This project forked from example-apps/bowling

0.0 2.0 0.0 102 KB

figure out and print the score of each frame for an array of rolls during a bowling match

bowling's Introduction

bowling

figure out and print the score of each frame for an array of rolls during a bowling match

A bowling match consists of ten frames. Each frame except for the tenth consists of one or two balls, or attempts to knock down the ten pins at the end of the alley. Doing so on the first ball of the frame is called a strike, and the second ball of the frame is not rolled. Knocking down all ten pins with both balls (having left some up with the first ball) is called a spare. If both attempts to knock down the pins leave some standing, the frame is called an open frame. A spare in the tenth frame gives the bowler one extra ball; a strike in the tenth gives him or her two extra balls. A bowling score is computed as follows. A strike counts as 10 points plus the sum of the next two balls. A spare counts as 10 points plus the next ball. Any other balls merely count as themselves, as do any bonus balls rolled as a result of a strike or a spare in the tenth frame. Suppose for example that the sequence of balls was

[9,1, 0,10, 10, 10, 6,2, 7,3, 8,2, 10, 9,0, 9,1, 10]

spacing is not important but it may make the example easier to understand

The output from the console or UI show be as follows:

Frame   score
-----   ----- 
 1       10 
 2       30 
 3       56 
 4       74 
 5       82 
 6      100 
 7      120 
 8      139 
 9      148 
 10     168

Submission intructions:

  1. Please fork this repo into your own github repo.
  2. Create a folder with your name or github haddle and develop your solution there
  3. Once complete submit a pull request to merge in your submission to this repo
  4. Afterwards be apart of the community and review other submission, comment and critique

bowling's People

Contributors

abrahamoshel avatar

Watchers

 avatar 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.