roulette-dande

1.0.7 • Public • Published

Main Points

The goal is to have a complete and working roulette system, with bet and credit management. In this package you can send information, arrange in certain way (explained below) and have a return of the result of all your bets.

At the moment the system is able to manage the request only per single player

Install

$ npm install roulette-dande

Usage

You can call the package with the well known syntax:

const roulette = require('roulette-dande');

First of all, you must set the initial credit of the player, using the setCredit(credit) method like this:

var onegilliondollar = 1; // a gillion is NaN!
roulette.setCredit(onegilliondollar);

You can later know what is the player credit calling the getter method:

var playerCredit = roulette.getCredit();

Then you can have your result calling the play(array) method which require a bet array to be passed. In this way, the code will extract a single number, evaluating all the bets:

var results = roulette.play(array); 

Pay attention: the extraction will happen every time you call the play method.

The return will be an array you can handle as a JSON object, which contains:

  • Initial credit of the player
  • First bet result
  • Second bet result (if there is one)
  • Other bet result (if there are any)
  • Final credit of the player after calculations

Readme

Keywords

Package Sidebar

Install

npm i roulette-dande

Weekly Downloads

2

Version

1.0.7

License

ISC

Unpacked Size

9.92 kB

Total Files

3

Last publish

Collaborators

  • dandelionsam