1. Variables you can use. ## 1) number of players at table ## 2) your cards ## 3) board ## 4) betting round ## 5) current bet (amount to you) ## 6) chips you 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 you're in ## 12) who's the dealer ## 13) how many tables are left in the tournament 2. Rules. a) 3 winners, payouts 13,8,5. b) Start with 1000 chips each, and blinds of 10 and 20. c) Small blind = 1/2 big blind (rounded to nearest integer). d) Blinds last 10 hands, then increase by 50 percent. (rounded) e) If # players left is 11-20, then players are split into 2 tables of equal size (or one off if # players is odd). Then 10 hands are played, no matter what. f) Prizes include deck of cards, cookies, highlighter. 3. Examples. unbeatable1 = function(numattable1, crds1, board1, round1, currentbet, mychips1, pot1, roundbets, blinds1, chips1, ind1, dealer1, tablesleft){ ## any pair, or AT-AK, a1 = 0 if((crds1[1,1] == crds1[2,1]) || ((crds1[1,1] > 13.5) && (crds1[2,1]>9.5))) a1 = mychips1 a1 } ## end of unbeatable version2 = function(numattable1, crds1, board1, round1, currentbet, mychips1, pot1,roundbets, blinds1, chips1, ind1, dealer1, tablesleft){ ## any pair, or AT-AK, or suited connectors a1 = 0 if((crds1[1,1] == crds1[2,1]) || ((crds1[1,1] > 13.5) && (crds1[2,1]>9.5)) || ((crds1[1,1]-crds1[2,1]==1) && (crds1[1,2] == crds1[2,2]))) a1 = mychips1 a1 } ## end of unbeatable wilma = function(numattable1, crds1, board1, round1, currentbet, mychips1, pot1, roundbets, blinds1, chips1, ind1, dealer1, tablesleft){ ## if pair of 9s or 10s, all in with probability 35% ## if higher pair, all in with prob. 50% a1 = 0 x = runif(1) if((crds1[1,1] == crds1[2,1]) && (crds1[2,1] > 8.5) && (crds1[2,1]<10.5) && (x<.35)) a1 = mychips1 if((crds1[1,1] == crds1[2,1]) && (crds1[2,1]>10.5) && (x<.50)) a1 = mychips1 a1 } ## end of wilma xena = 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 xena yolanda = 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 yolanda zebra = 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(mychips < 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 zebra timemachine = function(numattable1, crds1, board1, round1, currentbet, mychips1, pot1, roundbets, blinds1, chips1, ind1, dealer1, tablesleft){ ## any pair 7 or higher ## AK, AQ ## AJ if nobody's all in yet. ## if less than 3 times bb & one card is Ten or higher, then 75% a1 = 0 x = runif(1) if((crds1[1,1] == crds1[2,1]) && (crds1[1,1] > 6.5)) a1 = mychips1 if((crds1[1,1] == 14) && (crds1[2,1] > 11.5)) a1 = mychips1 if((crds1[1,1] == 14) && (crds1[2,1] == 11) && (currentbet <= blinds1)) a1 = mychips1 if((mychips1 < 3*blinds1) && (crds1[1,1] >= 10) && (x<.75)) a1 = mychips1 a1 } ## end of timemachine