Giter Club home page Giter Club logo

machinepoker's Introduction

Build Status

Machine Poker

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 - Poker hand library
  • 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 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

machinepoker's People

Contributors

farktronix avatar mdp avatar

Watchers

 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.