Giter Club home page Giter Club logo

bowling-challenge's Introduction

🎳 Bowling Scoreboard Challenge 🎳

Makers Weekend Challenge, Weeks 5 & 6

Using: Javascript, JQuery, Jasmine, DOM

The Big Lebowski

It seems that this year's all about tenpin bowling. Here's a fun little "The Big Lebowski"-themed quote generator I made a few months ago as part of the freeCodeCamp frontend development course.

The Task

THIS IS NOT A BOWLING GAME, IT IS A BOWLING SCORECARD. THE USER INPUTS THE ROLLS.

Count and sum the scores of a bowling game for one player (in JavaScript).

STRONG HINT, IGNORE AT YOUR PERIL: Bowling is a deceptively complex game. Careful thought and thorough diagramming β€” both before and throughout β€” will save you literal hours of your life.

My User Stories:

βœ… I want 10 frames per game
βœ… I want to roll twice per frame
βœ… I want each roll to be added to my frame’s total
βœ… I cannot roll more than the sum of 10 in one frame
βœ… I want to be able to roll in the gutter (0 points)
βœ… I want to be able to roll a strike (1 roll === 10)
βœ… If I roll a strike, I want 2 more rolls as a bonus
βœ… I want to be able to roll a spare (1 frame (2 rolls) === 10)
βœ… If I roll a spare, I want an extra roll (first roll in next frame = doubled as a bonus)
βœ… At the end of 10 frames, I want my total to be added up into a final score
βœ… If I roll a strike in frame 10, I want 2 more rolls
βœ… If I roll a spare in frame 10, I want one more roll
βœ… I want to be able to have a perfect game with strikes only (300 points)
βœ… I want to be able to have a gutter game (0 points)

Jasmine tests results:

Jasmine tests page 1

Jasmine tests page 2

Optional Extras

In any order:

  • Create a nice interactive animated interface with jQuery.
  • Set up Travis CI to run your tests.
  • Add ESLint to your codebase and make your code conform. (I'm using Prettier with VSCode)

You might even want to start with ESLint early on in your work β€” to help you learn Javascript conventions as you go along.

Bowling β€” how does it work?

Strikes

The player has a strike if he knocks down all 10 pins with the first roll in a frame. The frame ends immediately (since there are no pins left for a second roll). The bonus for that frame is the number of pins knocked down by the next two rolls. That would be the next frame, unless the player rolls another strike.

Spares

The player has a spare if the knocks down all 10 pins with the two rolls of a frame. The bonus for that frame is the number of pins knocked down by the next roll (first roll of next frame).

10th frame

If the player rolls a strike or spare in the 10th frame they can roll the additional balls for the bonus. But they can never roll more than 3 balls in the 10th frame. The additional rolls only count for the bonus not for the regular frame count.

10, 10, 10 in the 10th frame gives 30 points (10 points for the regular first strike and 20 points for the bonus).
1, 9, 10 in the 10th frame gives 20 points (10 points for the regular spare and 10 points for the bonus).

Gutter Game

A Gutter Game is when the player never hits a pin (20 zero scores).

Perfect Game

A Perfect Game is when the player rolls 12 strikes (10 regular strikes and 2 strikes for the bonus in the 10th frame). The Perfect Game scores 300 points.

Ten Pin Score Example

Code Review

In code review we'll be hoping to see:

  • All tests passing
  • The code is elegant: every class has a clear responsibility, methods are short etc.

Reviewers will potentially be using this code review rubric. Note that referring to this rubric in advance may make the challenge somewhat easier. You should be the judge of how much challenge you want.

bowling-challenge's People

Contributors

tansaku avatar dani-boo avatar gypsydave5 avatar spike01 avatar ptolemybarnes avatar neoeno avatar roidriscoll avatar maryrosecook avatar anitacanita 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.