Giter Club home page Giter Club logo

bowling-challenge-babbel's Introduction

Bowling Challenge

Summary

  • Frames: There are 10 frames
  • Frame: Each frame has 2 rolls.
  • Roll: Each roll has 10 pins.
  • Score: Player scores the number of pins knockeddown
    • strike: A player knocked-down all the 10 pins in a first roll, scores equals 10 plus the number of pins knocked down in the next two rolls.
    • spare: A player knocked-down ten pins in two rolls, scores equals 10 plus the number of pins knocked down in the next roll.

Structure

Below is project proposed Structure

  • -src
  • --_actions
  • --_reducers
  • --_constants
  • --_components
  • --_root
  • --_store
  • --lib

Description

What i intend to do was clear from my states and actions. I structure my states into frames, game , player and roll. These are explain Below

  • Frames: We have 10 frames and each frame consists of 2 rolls. Its therefore necessary to keep track of the current frame. This you can use to mark the beginning and end of the game.
  • Player: The player state or reducer is where i intend to add new player, monitor and store my players score, set if the player has strike or spare etc. This is a very important reducer in this project.
  • Game: The game store/state or reducer is necessary here because i believe, a player should have the option of restarting or replaying the game, The system on the other hand should be able to keep record for the existing session.
  • Roll: Roll store or reducer does not hold much. Its where i intend to mark the beginning and ending of each user rolls. A frame has two rolls and this state should help us determine when to move to the next.

I added a react-redux as can be noticed in my package because i intended to use that to connect my react components to redux store https://github.com/reactjs/react-redux/blob/master/docs/api.md#connectmapstatetoprops-mapdispatchtoprops-mergeprops-options. This in conjunction with reselect is how i work with props and redux in react https://github.com/reactjs/reselect .

I don't have a visual effect for a roll to hit or push pins, but i intend to use a random nmber generator class to determined scores here. And my score to detrmine the remaining pins as expected.

The _actions folder is where i keep my redux actions to be dispatch and the _constant folder hold my constants. The _components folder holds my reatc building blocks or tiny components. The _root folder is my entry point usually. The main container lies there. Incase of multiple container or pages app, i sually have another folder called conatiners. These are alot that cannot and beyond what i could achieved within the expected time.

bowling-challenge-babbel's People

Contributors

dansallau avatar

Watchers

James Cloos 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.