Here is an easy to understand bot code source: this bot will go all-in with good hands and will fold any other hands
#includeFor more information, go to bot-pokerth website If you have a bot, and if you want a bot fight, then please, let me know :)#include "pbot_lib_intf.h" /* IA strategy of this bot: play all in with strong cards, and fold any other cards */ static uint8_t card_color(uint8_t card) { return card/13; } static uint8_t card_value(uint8_t card) { return card%13; } /* return 1 if the hand is a good one */ static int is_good_hand(uint8_t cards[2]) { uint8_t c1 = card_value(cards[0]); uint8_t c2 = card_value(cards[1]); /* pair with at least {8,8} and up to {As,As} */ if (c1 == c2 && c1 >= 7) { return 1; } /* both cards are at least Jack */ if (c1 >= 10 && c2 >= 10) { return 1; } return 0; } /* main function called by bot-pokerth */ extern "C" double pb_process_frame(struct pb_frame *frame) { uint8_t user_chair = frame->userchair; /* sanity check */ if (frame->pbot_version != PBOT_INTF_VERSION) { printf("pbot_lib_intf version mismatch %d %d\n" , frame->pbot_version, PBOT_INTF_VERSION); return PB_ACT_ERROR; } if (is_good_hand(frame->players[user_chair].cards)) return PB_ACT_ALLIN; else return PB_ACT_FOLD; }