# machine-poker

> The library for Machine Poker Competitions

Latest version **0.5.1** (published 2013-11-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install machine-poker
pnpm add machine-poker
yarn add machine-poker
bun add machine-poker
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.1 |
| Published | 2013-11-25 |
| First published | 2012-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 0.8.x |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 77 |
| Author | Mark Percival |
| Maintainers | mdp |
| Keywords | competition, poker |

## Links

- npm: https://www.npmjs.com/package/machine-poker
- Repository: https://github.com/mdp/MachinePoker
- Issues: https://github.com/mdp/MachinePoker/issues
- npm.io page: https://npm.io/package/machine-poker

## Dependencies (5)

- [async](https://npm.io/package/async.md) >=0.1.22
- [hoyle](https://npm.io/package/hoyle.md) >=0.2.0
- [binions](https://npm.io/package/binions.md) >=0.6.4
- [request](https://npm.io/package/request.md) >=2.11.4
- [optimist](https://npm.io/package/optimist.md) >=0.3.5

## Recent versions

- 0.5.1 (latest) — 2013-11-25
- 0.5.0 — 2013-11-19
- 0.4.0 — 2013-11-18
- 0.3.2 — 2012-11-30
- 0.3.1 — 2012-11-23
- 0.3.0 — 2012-11-22

## README

[![Build Status](https://secure.travis-ci.org/mdp/MachinePoker.png)](http://travis-ci.org/mdp/MachinePoker)

![Machine
Poker](https://s3.amazonaws.com/img.mdp.im/MachinePokerLogo.png)
# Machine Poker

Machine Poker is a libray which allows you go build poker bots
and have them compete against each other in tournaments.

Currently this supports bots written in Javascript running locally,
or bots that play remotely via HTTP and conform to the MachinePoker API

## Getting started

### Requirements

- NodeJS >= 0.10.x
- A basic understanding of javascript

#### Dependencies

- [Hoyle](https://github.com/mdp/hoyle) - Poker hand library
- [Binions](https://github.com/mdp/binions) - Poker table library
- Request
- Async
- Optimist

### Installation

#### Via NPM

    npm install machine-poker

#### Local

    git clone git://github.com/mdp/MachinePoker.git
    cd MachinePoker
    npm install

### Build your bot

Check [this guide on the wiki](MachinePoker/wiki) to start building your own bot

### Cofiguring a new game

New matches are built using the Machine Poker API

    var MachinePoker = require('machine-poker');
        , LocalSeat = MachinePoker.seats.JsLocal
        , RemoteSeat = MachinePoker.seats.Remote
        , CallBot = require('./examples/bots/callBot')
        , RandBot = require('./examples/bots/randBot')
        , FoldBot = require('./examples/bots/foldBot')
        , narrator = MachinePoker.observers.narrator
        , fileLogger = MachinePoker.observers.fileLogger('./examples/results.json');

    var table = MachinePoker.create({
      maxRounds: 100
    });

    // Source be found at: https://github.com/mdp/RandBot
    var remotePlayerUrl = "http://randbot.herokuapp.com/randBot";

    var remotePlayer = RemoteSeat.create(remotePlayerUrl);
    remotePlayer.on('ready', function () {
      var players = [
        remotePlayer
        , LocalSeat.create(CallBot)
        , LocalSeat.create(FoldBot)
        , LocalSeat.create(RandBot)
        , LocalSeat.create(RandBot)
      ];
      table.addPlayers(players);
      table.on('tournamentClosed', function () { process.exit() } );
      table.start();
    });

    // Add some observers
    table.addObserver(narrator);
    table.addObserver(fileLogger);

### Updating the repo

The sample bots will evolve over the coming weeks in order to give you
some better opponents. You can just update the repo to keep up to date.

    git pull origin master

### Todo

- Fix wiki

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