A No-limit Texas Hold'em poker tournament for Javascript bots played via pull requests with Travis CI as the dealer.
- status3Bot $152306
- ThoseAreMyFish $105849
- edi9999 $67519
- SneakyCharlie $17395
- FlopASetBot $3520
- whistle_tips $2081
- blaBot $1330
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.
- Clone this repo and run 'npm install'
- Modify the existing challenger bot
- Tune it to double your money over the course of 25,000 hands (50 Tournaments of 500 hands each)
- Test it with
npm test
until your confident it has a good chance of winning. - Submit a pull request. If the Travis tests pass, you win the bounty.
- First pull request that passes wins the current round.
- Winning bot is added to the table. Contest repeats.
- The game is No-limit Texas Hold'em ($10-20), with each player starting with $1000
- Only one file may be modified in the pull request, 'players/challengerBot.js' (Pull requests to fix other issues are gladly accepted however)
- You cannot load any modules. This includes Node.js core modules (fs, http, etc.)
- Source code may not be obsfuscated/minified. Everyone should be able to learn from your winning bot.
- Bots must win through legitimate poker play. Hacking is fine, but the bounty will only be paid to legitimate winners. Think of it this way, if your bot was in a casino, would it get kicked out or arrested?
- Only 2 attempts per user, per 24 hour period. You can't just keep updating the pull request and having Travis repeatedly rerun the tests to try and win by luck. I'll consider this is a soft limit, but in general, don't be an ass. TravisCI is a fantastic tool and I don't want to abuse their time or resources.
# 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 cards
In 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.
- Wagers of less than the amount required to call are considered a 'fold'
- Wagers of '0', when the call amount is '0', are considered a check.
- Wagers greater than the call, but less than the minimum raise will result in a call
- A negative wager will force a fold.
- Failure to return an integer will assume a wager of '0', which may in turn result in a fold
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:
- TimidBot only plays pairs players/timidBot.js
- UnpredictableBot raises randomly at different stages of the game players/unpredictableBot.js
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)
- Anyone with a small amount of programming experience should be able to play.
- It should be easy to run a tournament for a group of competitors safely (Skilled play vs Clever hacks)
- Competitors should be able to lose (or win) real money.
- Hardware constraints (ex. Bots are each hosted on their own Raspberry Pi)
- Found a bug? By all means feel free to report it or send me a pull request.
- The next step is to build a tournament system for handling a real-time tournament with separate players, each on their own host.
- It would be great to give people a way to watch or monitor game play.
- Texas Hold'em Wikipedia
- Poker code and depenencies
- MachinePoker runs this competition
- Binions is the core code for playing Texas Hold'em
- Hoyle is the card/hand evaluator code
- #machinepoker on Freenode
- Node.js >= 0.10
- an 80386sx microprocessor or better with at least 8 MB of RAM
- OSx, Ubuntu, BSD, or some other POSIX compatible file system. (I don't have a windows machine to test with. Happy to take PR's to fix this)