The template can be used to design a new bot. There are a few in there to act as examples. By default the bots will play one complete game, with a buy in of 1000 and a blind of 10. It's tournament style, so only one bot can win.
The program can be run with these commands.
npm testwill run the program and output data to a text file explaining every action the bots took.npm startwill run the program with no output except the winner at the end.npm watchwill run the program slowly in the console so you can read the outputs in real time. The program has command line arguments as well to augment the game.-b, --buy-in (amount)Lets you set the buy in amount, the default is 1000.-v, --verboseOutputs everything the bots are doing, it is recommended to pipe this into a file.-s, --slowRuns the bot slowly, make sure you also specify-votherwise you will have a slow program with no output.-r, --roundsLets you specify the amount of games that will be played.-t, --time-limit (amount in ms)Lets you specify the amount of time bots have to make a move, the default is 1 second.
- Bots only have 1 second to make their turn unless otherwise specified, anything over that will automatically fold their hand.
- Bots are limited to the packages that are already installed.
- Bots cannot use commands that would give them an unfair advantage, such as looking at other players cards.
- Just makes random moves that are legal.
- Will try to bet or raise if possible.
- If anyone else raises she will also raise.
- Will only check or call if not enough money to raise or bet.
- Will never bet or raise, only check or call.
- Will only call if hand is 6 Pair or better.
- The only default bot to actually look at his hand.
- Makes decisions based on the current state of the game (pre-flop, flop, turn, river).
- Will get greedy if hand is good.
Move history can be viewed to see what other players have done, its a map so you can access players move history. You can iterate over the list, or by using playerData.table.lastActor.id you can view a specific player.
When raising you must send it as the current bet + your raise amount, see other AI for example.
When betting you must bet more or equal to the big blind, which you can get from playerData.table.bigBlind.
Fold, Call, and Check do not need value parameters.
To see how to call functions, see one of the example AI, Random Randy contains all possible calls.
To view documentation for this you can view this https://www.npmjs.com/package/@bradyy/poker-engine
For solving the actual hand you get you can use the helper package https://www.npmjs.com/package/pokersolver
You can see the AI Thinking Thomas for help understanding this package better.