## what can they use? ## 1) number of players at table ## 2) their cards ## 3) board ## 4) betting round ## 5) current bet (amount to them) ## 6) chips they have left at the moment ## 7) pot ## 8) history of total betting for each player in each round ## 9) big blind ## 10) tablechips ## 11) which seat they're in ## 12) who's the dealer ## 13) how many tables are left in the tournament ## 1) numattable1. integer. ## number of players at the table ## ## 2) cards1. 2x2 matrix. ## cards1[1,1] = the number of card 1 (between 2 and 14). cards[1,2] = suit of card 1 (a number between 1 and 4). ## cards1[2,1] = the number (2-14) of card 2. cards[2,2] = suit of card 2 (1-4). Ace = 14. ## ## 3) board1. 5x2 matrix. ## board1[1,1] = number of first card (2-14). ## board1[1,2] = suit (1-4) of first card. ## Both are zero if the card hasn't been seen yet. ## For instance, if bettinground1 < 3, then board[4,1] = board1[4,2] = 0. ## ## 4) round1. integer. ## 1 = preflop, 2 = after flop, 3 = after turn, 4 = after river. ## ## 5) currentbet. integer. ## how much MORE it is to you to stay in, right now. ## ## 6) mychips1. integer. ## how many chips you have left at the moment. ## ## 7) pot1. integer. ## how much is in the pot at the moment. ## ## 8) roundbets. numattable1 x 4 matrix. ## roundbets[i,j] = total amount the player in seat i put in, in betting round j. ## ## 9) blinds1. integer. ## big blind amount. (regardless of whether the player in the big blind can afford it). ## ## 10) chips1. vector of length numattable1. ## chips1[i] = how many chips the player in seat i has left. ## ## 11) ind1. integer. ## Which seat you're in. (So, mychips1 = chips1[ind1]). ## ## 12) dealer1. integer. ## Which seat the dealer is in. ## (If only 2 players are left, then I use the convention that the "dealer" is the big blind.) ## ## 13) tablesleft. integer. ## How many tables are left in the tournament (including yours). tommy = function(numattable1, crds1, board1, round1, currentbet, mychips1, pot1, roundbets, blinds1, chips1, ind1, dealer1, tablesleft){ ## all in with any pair. a1 = 0 if(crds1[1,1] == crds1[2,1]) a1 = mychips1 a1 } ## tommy ursula = function(numattable1, crds1, board1, round1, currentbet, mychips1, pot1, roundbets, blinds1, chips1, ind1, dealer1, tablesleft){ ## if pair of 9s or better, then all in a1 = 0 if((crds1[1,1] == crds1[2,1]) && (crds1[2,1] > 8.5)) a1 = mychips1 a1 } ## end of ursula vera = function(numattable1, crds1, board1, round1, currentbet, mychips1, pot1, roundbets, blinds1, chips1, ind1, dealer1, tablesleft){ ## if any pair, suited anything, or if the smaller card is at least 9, then all in a1 = 0 if((crds1[1,1] == crds1[2,1]) || (crds1[1,2] == crds1[2,2]) || (crds1[2,1] > 8.5)) a1 = mychips1 a1 } ## end of vera william = function(numattable1, crds1, board1, round1, currentbet, mychips1, pot1, roundbets, blinds1, chips1, ind1, dealer1, tablesleft){ ## if you only have less than 3 times the big blind, then all in. ## if AA, then all in. ## if T9, then all in with 40% prob. ## if nobody's gone all in yet, then go all in. ## if KK or QQ, and less than 10 players at table, then all in. a1 = 0 if(mychips1 < 3*blinds1) a1 = mychips1 if((crds1[1,1] == 14) && (crds1[2,1] == 14)) a1 = mychips1 if((crds1[1,1] == 10) && (crds1[2,1] == 9)){ u1 = runif(1) if(u1 < .4) a1 = mychips1 if(u1 > .4) a1 = 0 } if(currentbet == blinds1) a1 = mychips1 if((crds1[1,1] == crds1[2,1]) && (crds1[1,1] > 11.5) && (numattable1<10)) a1 = mychips1 a1 } ## end of william xena = function(numattable1, crds1, board1, round1, currentbet, mychips1, pot1, roundbets, blinds1, chips1, ind1, dealer1, tablesleft){ ## if pair of 10s or higher, all in for sure, no matter what. ## if AK or AQ, all in with probability 75%. ## if pair of 7s or higher and there are 6 or fewer players ## at your table (including you), then all in. ## if your chip count is less than twice the big blind, go all in with any cards. ## if nobody's raised yet: ## ... and if there are 3 or fewer players left behind you, ## then go all in with any pair or any ace. ## ... and there's only 1 or 2 players behind you, ## then go all in with any cards. a1 = 0 x = runif(1) ## x is a random number between 0 and 1. y = max(roundbets[,1]) ## y is the maximum bet so far. big1 = dealer1 + 2 if(big1 > numattable1) big1 = big1 - numattable1 z = big1 - ind1 if(z<0) z = z + numattable1 ## the previous 4 lines make it so z is the number of players left to act behind you. if((crds1[1,1] == crds1[2,1]) && (crds1[2,1] > 9.5)) a1 = mychips1 if((crds1[1,1] == 14) && (crds1[1,2]>11.5) && (x<.75)) a1 = mychips1 if((crds1[1,1] == crds1[2,1]) && (crds1[2,1] > 6.5) && (numattable1 < 6.5)) a1 = mychips1 if(mychips1 < 2*blinds1) a1 = mychips1 if(y <= blinds1){ if((z < 3.5) && ((crds1[1,1] == crds1[2,1]) || (crds1[1,1] == 14))) a1 = mychips1 if(z < 2.5) a1 = mychips1 } a1 } ## end of xena