## simulate randomly scattered pts in a diamond ## with vertices at (-1,0), (0,1), (1,0), (0,-1). z = matrix(0,ncol=2,nrow=1200) j=1 for(i in c(1:1200)){ x = runif(1)*2-1 y = runif(1)*2-1 if(abs(x)+abs(y) < 1){ z[j,] = c(x,y) j = j+1 } } j ## to check that you have kept at least 500 pts z2 = z[1:500,] plot(z2) ## or plot(z2[,1],z2[,2]) ## or, a little better, since the boundary is set up right: plot(c(-1,0,1,0,-1),c(0,1,0,-1,0),type="n",xlab="",ylab="") points(z2,pch=".") diamond3 = function(k,n){ z = matrix(0,ncol=2,nrow=n) j=1 for(i in c(1:n)){ x = runif(1)*2-1 y = runif(1)*2-1 if(abs(x)+abs(y)<1){ z[j,] = c(x,y) j = j+1 } } if(j 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