# node-casino-engines

Latest version **1.1.1** (published 2020-09-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install node-casino-engines
pnpm add node-casino-engines
yarn add node-casino-engines
bun add node-casino-engines
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2020-09-02 |
| First published | 2019-12-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 20.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | gfauchart |

## Links

- npm: https://www.npmjs.com/package/node-casino-engines
- npm.io page: https://npm.io/package/node-casino-engines

## Dependencies (2)

- [lzutf8](https://npm.io/package/lzutf8.md) ^0.5.5
- [js-combinatorics](https://npm.io/package/js-combinatorics.md) ^0.5.4

## Recent versions

- 1.1.1 (latest) — 2020-09-02
- 1.1.0 — 2019-12-07
- 1.0.3 — 2019-12-03
- 1.0.2 — 2019-12-01
- 1.0.1 — 2019-12-01
- 1.0.0 — 2019-12-01

## README

# node-casino-engines


## Roulette engine
```
import RouletteEngine, { SlotBetType } from '../index';

const engine = new RouletteEngine();

const { bets } = engine
  .registerPlayer({playerId: '1', balance: 100 })
  .placeBet('1', {type : SlotBetType.Straight, value: 0, amount: 5})
  .placeBet('1', {type : SlotBetType.Red, amount: 5})
  .placeBet('1', {type : SlotBetType.Black, amount: 5})
  .spin();
 ```
 
 
 ### Resume a game from serialized token
 
 ```
import RouletteEngine, { SlotBetType } from '../index';

const engine = new RouletteEngine();

const serialToken = engine
  .registerPlayer({playerId: '1', balance: 100 })
  .placeBet('1', {type : SlotBetType.Straight, value: 0, amount: 5})
  .serialize();
   
(new RouletteEngine(serialToken))
  .placeBet('1', {type : SlotBetType.Red, amount: 5})
  .placeBet('1', {type : SlotBetType.Black, amount: 5})
  .spin();
 ```

---
_Source: https://npm.io/package/node-casino-engines · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
