A No-limit Texas Hold'em poker tournament for Javascript bots played via pull requests with Travis CI as the dealer.
JsPoker is an automated poker competition, where your opponents are bots written in Javascript. At the moment they are each quite unintelligent/unimaginative. The challenge is to write a competitor in JS that can handily beat them all over the course of 50 tournaments, each with a maximum of 500 hands.
You win if your bot beats the challenged return on it's money, and we consider a bounty claimed when your bot is submitted via a pull request and the Travis-CI tests pass. (Tests will run the tournament simulation and pass or fail based on performance)
Example:
Each bot starts with $1000 for every tournament, regardless of past performance. It must play 50 tournaments against the other bots. Therefore the bot is putting up $50k in total in the tournaments and needs to see a return of $100k if the challenge is 2x. This may seem hard, but keep in mind that over the course of 50 tournaments, the other bots are putting $300k into the pot, you only need to take 1/3 of this.
If you win, your bot will be added to the table to play future bots.
Like many people, I like to play poker and lose money. The obvious next step was to automate this.
npm test
until your confident it has a good chance of winning.# Requires NodeJs >= 0.10.0
git clone https://github.com/mdp/JsPoker.git
cd JsPoker
npm install
npm test
# Now go and turn your bot into a champion!
You can test out your bot with a small 100 hand game using play.js
node play.js
The output will include each bots betting actions and cards held in order to make tuning and debugging easier.
Bots are handed a game data object with the current state of the game and simply have to return a wager as an integer.
Here's an example game date payload: GameData.json
Game object consists of 6 properties:
self
Your bots current standing/cardshand
The current number hand being playedstate
The betting state of the game. Ex. 'river'betting
Betting options available - These are incremental wager optionsplayers
Array of each player, their actions for any round, and wager/stackcommunity
Community cardsIn Texas Hold'em, you're only real options are to stay in the game, or fold. With that in mind bots only need to return an integer representing the additional amount they wish to add to the pot.
The game objects betting
property shows the betting options available to the player/bot. call
represents the additional amount needed to stay in the game, while raise
represents the minimum amount
a player can bet if they wish to raise.
Here's an extremely simple bot that only raises each betting round:
// I only raise!
module.exports = function () {
var info = {
name: "RaiseBot"
};
function play(game) {
if (game.state !== "complete") {
return game.betting.raise;
}
}
return { play: play, info: info }
}
Take a look at the code for the current set of players. Here are a couple decent examples:
MachinePoker (The library behind JsPoker) will eventually be a platform that allows people to play their bots against each other in real time for real money (In jurisdictions that allow it)