darts-scorer-core

1.3.0 • Public • Published

darts-scorer-core

Build Status Code Coverage Documentation Coverage npm Dependency Status devDependency Status semantic-release

This is a core module for building Darts games and front-end.

It is easy to extend to match own needs.

Installation

npm install darts-scorer-core --save-dev

Example Usage

import dartsScorerCore from 'darts-scorer-core';
 
let player1 = new dartsScorerCore.Player('Player 1');
let player2 = new dartsScorerCore.Player('Player 2');
 
let game = new dartsScorerCore.games.Darts501Game([player1, player2]);
 
game.throw(10);
game.throw(15, 2);
game.throw(20, 3);
 
console.log('Player 1 points', game.currentPlayerTotalPoints);
 
game.nextPlayer();
 
game.throw(1);
game.throw(18, 2);
game.throw(19, 3);
 
console.log('Player 2 points', game.currentPlayerTotalPoints);
 
game.nextRound();
 

Contributing

Follow the airbnb styleguide.

Requires node ^5.0.0.

npm install 

License

MIT

Package Sidebar

Install

npm i darts-scorer-core

Weekly Downloads

6

Version

1.3.0

License

MIT

Last publish

Collaborators

  • wrona