180 likes | 244 Views
Grad Unit Project Update 1 Juan Marulanda Arias Nate Ebel Benjamin Jeffery Sanqing Yuan. Texas Hold'Em Game for Android Tablet. Customer Meeting. Had customer meeting w/ Dr. Oman 9/20 Several Main Customer Concerns Cards should be represented graphically Betting should be controllable
E N D
Grad UnitProject Update 1Juan Marulanda AriasNate EbelBenjamin JefferySanqing Yuan Texas Hold'Em Game for Android Tablet
Customer Meeting • Had customer meeting w/ Dr. Oman 9/20 • Several Main Customer Concerns • Cards should be represented graphically • Betting should be controllable • Chip amount for each player should be displayed • Current pot amount should be displayed • Computer player's turns should happen in real game time not instantly • Computer player decisions should be probability based
Phase 1 • Phase 1 is our first time through our development spiral • Goals • Have a basic GUI prototype with blinds taken out, labeling working, dealer button movement, basic betting • Start designing needed classes such as Player, Card, Deck • Research and evaluate hand evaluators • Research and evaluate “AI” options
Class of deck • Shuffle (initialization) • Deal cards (the burn, the flop, the turn and the river) Class of table • Community cards (five cards that are face-up on the table) • Pot (amount of money or chips on the table) • Check win Class of player • Status of the player (position on the table, fold or not) • Two cards that are face-down • Chips bet and left • Action (check, call, raise or fold)
Deck Class private: struct deck { char suit; // d, s, h and c. char rank;// 1,2,3,…,J, Q, K and A. int id;// 1,2,3,…,52 }; typedef deck pack; Public: //constructor deck() { pack pack1(52) = { {d, 1, 1}, {d, 2, 2}, {d, 3, 3}, … {c, A, 52} }; pack pack2[52]; // random order of elements from pack1 } pack pop();//deal cards (the burn, the flop, the turn and the river)
Poker Table (Game Manager) private: struct deck { char suit; // d, s, h and c. char rank; // 1,2,3,…,J, Q, K and A. int id; // 1,2,3,…,52 }; typedef deck pack; int pot; Public: //constructor table() { pack pack[5]; // there are total five community cards pot = 0; } void add_community_card(pact p); // add community card void addpot(int n); // add bet into pot void check_win();
Player Class private: struct deck { char suit; // d, s, h and c. char rank; // 1,2,3,…,J, Q, K and A. int id; // 1,2,3,…,52 }; typedef deck pack; int table_position; int fold_status; int chip_left; int chip_bet; public: player() //constructor { pack private_cards[2]; // there are total two private cards fold_status = 0; // 0 means not fold, 1 means fold. chip_left = 100; // this is the starting money each player has. chip_bet = 0; } void move(); // it depends on hand evaluator and AI model. // it will also update chip_left and chip_bet
Take five cards from the board • Take two cards from each player • Make the best five-card hand for each player • Compare hands to find the winner • 133,784,560 possible poker hands
Look-up tables Catus Kev (KevinSuffecool) After a lot of thought, I had a brainstorm to use prime numbers. I would assign a prime number value to each of the thirteen card ranks, in this manner: Rank Deuce Trey Four Five Six Seven Eight Nine Ten Jack Queen King Ace Prime 2 3 5 7 11 13 17 19 23 29 31 37 41
The beauty of this system is that if you multiply the prime values of the rank of each card in your hand, you get a unique product, regardless of the order of the five cards. In my previous example, the King High Straight hand will always generate a product value of 14,535,931. Since multiplication is one of the fastest calculations a computer can make, we have shaved hundreds of milliseconds off our time had we been forced to sort each hand before evaluation.
private String drb_Name_Hand(int handtype) { switch (handtype) { case -1: return ("Hidden Hand"); case 1: return ("High Card"); case 2: return ("Pair"); case 3: return ("Two Pair"); case 4: return ("Three of a Kind"); case 5: return ("Straight"); case 6: return ("Flush"); case 7: return ("Full House"); case 8: return ("Four of a Kind"); case 9: return ("Straight Flush"); default: return ("Very Weird hand indeed"); } }
http://en.wikipedia.org/wiki/Poker_probability_%28Texas_hold_%27em%29http://en.wikipedia.org/wiki/Poker_probability_%28Texas_hold_%27em%29 http://www.math.hawaii.edu/~ramsey/Probability/PokerHands.html
Roulette Wheel Selection Random Value http://www.casinoreviewbank.com/dictionary/guide/Roulette_Wheel.html