Code Monkey home page Code Monkey logo

bowling-game--ignorant-solution-'s Introduction

Bowling Game (ignorant solution)

This attempt at scoring a Bowling Game came from attending a software craftmenship session at SkillMatter. Titled "Readable and Intention Revealing Code this session was based upon the Bowling Game Kata.

This solution is ignorant because it uses very little of the original Kata. I didn't want to be influenced too much by the Kata (I hope to study this aftewards). However I did pick up from it the idea that the LastFrame is different from other Frames, and probably also the idea that Frame is a seperate class.

One of my biggest problems with this problem was not understanding how bowling scoring works. In the session at Skill Matter I had no idea about this. This made it very difficult to reveal intentions with any clarity. With hindsight this is pretty obvious, but in these sorts of events one tends to skim the specs and get stuck in.

Having worked on this solution (and read about bowling scoring on Wikipedia) a few things stand out

  • a game consists of ten frames
  • each frame has a maximum score of 30
  • the last frame is different from the rest
  • if a frame is a strike or a spare its score will be dependent on subsequent rolls

On the technical side making the roll method return self (for Game and Frame) is very useful - you can do game.roll(5).roll(6).

Normally I like to use the commit log to document the history of my code. This project is a really poor example of this. Lack of clear intentions and rushing are partly to blame.

bowling-game--ignorant-solution-'s People

Contributors

diabolo avatar

Stargazers

 avatar

Watchers

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