## MAKE TEAMS: x = scan("names.txt",what="character",sep="\n") n = length(x) # name1 = as.character(1:floor(n/3)) name1 = rep("0",26) for(i in 1:26) name1[i] = intToUtf8(96+i) teams = function(){ y = x[sample(n)] for(i in 1:length(name1)){ cat("\n", "team", name1[i], y[(3*i-2)], ". ", y[(3*i-1)], ". ",y[(3*i)],". ") } cat(y[3*i+1],". ") } teams() Project teams: team a LEE, YU JIN . ALAEV, MOISEY . XUAN, XIAOCONG . team b MARTIN, JULIA MOLLY . CHOI, HYEONGJIN . LOPEZ, KEVIN JOSE . team c TAN, HE . APUZZIO, OLIVIA R . BAEK, KYUNGCHAE . team d XIA, BOTAO . MIRPURI, SHAIL NAVIN . JIANG, BRYCE . team e KIM, EUIJUN . NASHNER, AUDREY NICOLE . ADIBI, ARYA CYRUS . team f PATEL, NITISH . OTSU, SEIJI SAMUEL . LI, ZIRONG . team g ZHANG, YIKUN . LU, ZHENG . TRUONG, CINDY . team h GAO, FAN . VASSAR, TAYLOR DARLEAN . ZHANG, HUI . team i GALVEZ, IAN CARLOS . HAO, BRANDON . MAI, HAOMIN . team j LU, YITONG . AHMAD, SAJAA . LANG, JINGYI . team k TANG, AMY . DU, YUCHENG . LIU, ANDREW DAVID . team l LIMB, REBEKAH . SUMPTER, JASON YU . GOLD, EDAN . team m JOHAL, ANNIKA KAUR . ZHAO, ER . XU, AIMEE FRANCES . team n UEDA, TAKUMI . SHI, MICHAEL BOYU . ZHANG, WENWEN . team o CHEN, CHELSEA ELLEN . AMIRI KAMALABAD, PARSA . LU, ZOE YIWEN . team p LUONG, MIA . LEE, INGYU . OBA, TAKAO . team q ZHAO, YILIA . PANG, ALEXANDER KAIRUI . ZHAO, ALAIR K . team r PAKIN, ZACHARY JOSEPH . DUNKER, RYAN JAMSHEED . PARTAIN, MILES JACOB . team s GAMEZ, SOFIA . ZHAO, BRANDON SIHAN . LEE, JINHYO . team t ZHAO, DYLAN . ESPARZA, LETZI . UENO, SHOICHIRO . team u PARK, NICOLE HANA . DHAWAN, VISHNU . ZHOU, ZHITONG . team v CHA, JONG HYUN . KIM, KYLE WOOJUNG . CERVANTES, SAUL . team w LEE, DAN HIEU . JUNG, JAEWON . ROMANI, BRUNO RODRIGO . team x AYILOGE, AYO . VAINBERG, EMILY . SANCHEZ, LINDA . team y HOUSTON, KATHERINE ESPINOSA . VUONG, ETHAN . GU, LEO . team z NGUYEN, THI THANH CHI . CHEN, YANZHANG . CHEN, HUBERT . SOHN, DARREN JOONGSUH . ## EXAMPLES:, install.packages("holdem") library(holdem) tommy ursula vera william xena Iveybruin = function (numattable, cards, board, round, currentbet, mychips, pot, roundbets, blinds, chips, ind, dealer, 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 a = 0 if ((cards[1, 1] == cards[2, 1]) && (cards[1, 1] > 8.5)) a = mychips if (cards[2,1] > 9.5) a = mychips if(mychips < 3*blinds) a = mychips a } ## end of Iveybruin allinSAK = function (numattable, cards, board, round, currentbet, mychips, pot, roundbets, blinds, chips, ind, dealer, tablesleft) { #all in with any pair, lower card 10 or higher, or have an A #all in if chips less than 3 times the blind a=0 if (cards[1, 1] == cards[2, 1]) a = mychips if (cards[2, 1] > 9.5) a = mychips if (cards[1,1] == 14) a = mychips if(mychips < 3*blinds) a = mychips a } poker = function(numattable, cards, board, round, currentbet, mychips, pot, roundbets, blinds, chips, ind, dealer, tablesleft){ a = 0 # all in with pocket pair of Jacks, Queens, Kings, or Aces, or AK of any suits if((cards[1,1] == cards[2,1]) && (cards[1,1] >= 11)) a = mychips if((cards[1,1] == 14) && (cards[2,1] == 13)) a = mychips # all in with AQ, AJ, KQ if same suit and no one else is all in yet if(currentbet <= blinds){ if((cards[1,1] == 14) && (cards[2,1] >= 11) && (cards[1,2] == cards[2,2])) a = mychips if((cards[1,1] == 13) && (cards[2,1] == 12) && (cards[1,2] == cards[2,2])) a = mychips } # all in with any pocket pair if only 1-2 players left to play and nobody is all in yet big.blind = dealer + 2 if(big.blind > numattable) big.blind <- big.blind - numattable players.left = big.blind - ind if(players.left < 0) players.left = players.left + numattable ## the 4 lines above make it so player.left = how many players haven't acted yet. if(currentbet <= blinds){ if((players.left <= 2) && (cards[1,1] == cards[2,1])) a = mychips } a }