## No class Thu Oct24! ## MAKE TEAMS:, x = c("Madeline", "Kyle", "Ben", "Jonathan", "Hayden", "Jeffrey", "Arthur", "Abby", "Neil", "Jessica", "Timothy", "RyanR", "Georgia", "Sofia", "Eli", "RyanW", "Michelle", "Arianna") n = length(x) name1 = as.character(1:(n/2)) teams = function(){ y = x[sample(n)] for(i in 1:(length(name1))){ cat("\n", "team", name1[i], y[2*i-1], ". ", y[2*i], ". ") } } teams() Project teams: team 1 Sofia . Arthur . team 2 Jeffrey . Madeline . team 3 Georgia . Jessica . team 4 Timothy . Kyle . team 5 Hayden . Ben . team 6 Eli . Arianna . team 7 RyanW . Jonathan . team 8 Abby . Neil . team 9 Michelle . RyanR . river: sofia, timothy, hayden, ben. cards Qd: ryanw, jonathan, abby, ryanr. experience: madeline, georgia, kyle, michelle. position: arthur, jeffrey, jessica, neil. ## EXAMPLES:, install.packages("holdem") library(holdem) tommy ursula vera william xena tommy = function (numattable1, crds1, board1, round1, currentbet, mychips1, pot1, roundbets, blinds1, chips1, ind1, dealer1, tablesleft) { a1 = 0 if (crds1[1, 1] == crds1[2, 1]) a1 = mychips1 a1 } ursula = function (numattable1, crds1, board1, round1, currentbet, mychips1, pot1, roundbets, blinds1, chips1, ind1, dealer1, tablesleft) { a1 = 0 if ((crds1[1, 1] == crds1[2, 1]) && (crds1[2, 1] > 8.5)) a1 = mychips1 a1 } vera = function (numattable1, crds1, board1, round1, currentbet, mychips1, pot1, roundbets, blinds1, chips1, ind1, dealer1, tablesleft) { a1 = 0 if ((crds1[1, 1] == crds1[2, 1]) || (crds1[1, 2] == crds1[2, 2]) || (crds1[2, 1] > 8.5)) a1 = mychips1 a1 } william = function (numattable1, crds1, board1, round1, currentbet, mychips1, pot1, roundbets, blinds1, chips1, ind1, dealer1, tablesleft) { 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 < 0.4) a1 = mychips1 if (u1 > 0.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 } Iveybruin = function (numattable1, crds1, board1, round1, currentbet, mychips1, pot1, roundbets, blinds1, chips1, ind1, dealer1, tablesleft) { ## all in with any 9 pair or higher, or if lower card is 10 or higher, ## or if I have less than 3 times the big blind a1 = 0 if ((crds1[1, 1] == crds1[2, 1]) && (crds1[1, 1] > 8.5)) a1 = mychips1 if (crds1[2,1] > 9.5) a1 = mychips1 if(mychips1 < 3*blinds1) a1 = mychips1 a1 } ## end of Iveybruin