Ikhan McClarty Devin Gaines Graham Gimbert James Cefaratti Kwang Kim Monarch Shah Exploration of Design Alternatives.

Slides:



Advertisements
Similar presentations
© Glenn Rowe AC Lab 2 A simple card game (twenty- one)
Advertisements

Algorithm Analysis.
Final Specification KwangMonarchIkhanJamesGraham.
Mathematics and the Game of Poker
Code Club Session 3 Shark Eats Fish. Picture of finished product here.
Mrs. Chapman. Tabs (Block Categories) Commands Available to use Script Area where you type your code Sprite Stage All sprites in this project.
Chapter 20 Thinking Big: Functions. Copyright © 2006 Pearson Addison-Wesley. All rights reserved Anatomy of a Function Functions are packages for.
Searching and Sorting Copyright Prentice Hall (with modifications by Evan Korth)
Texas Hold’em Poker Simulation Project Monarch ^ James Ikhan Kwang Graham Devin Organized by M^JIK Game Developers Members Include:
Milestone 4 Devin Gaines Devin Gaines Graham Gimbert Graham Gimbert Ikhan Mcclarty Ikhan Mcclarty James Cefaratti James Cefaratti Kwang Kim Kwang Kim Monarch.
Using Probabilistic Knowledge And Simulation To Play Poker (Darse Billings …) Presented by Brett Borghetti 7 Jan 2007.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
Arrays Data Structures - structured data are data organized to show the relationship among the individual elements. It usually requires a collecting mechanism.
CS320n –Visual Programming Interactive Programs Mike Scott (Slides 5-1)
1 CSE1301 Computer Programming: Lecture 25 Software Engineering 2.
Proposal 13 HUMAN CENTRIC COMPUTING (COMP106) ASSIGNMENT 2.
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
Chapter 11: understanding randomness (Simulations)
Games and Simulations O-O Programming in Java The Walker School
Describing algorithms in pseudo code To describe algorithms we need a language which is: – less formal than programming languages (implementation details.
ARCHIBUS Log On Instructions. Log Into ARCHIBUS Web Central Log In Screen 1.Open your Internet browser. 2.Enter the URL to view the ARCHIBUS Login Page.
Passing Other Objects Strings are called immutable which means that once a String object stores a value, it never changes –recall when we passed a message.
Sequence Diagram Tutorial
Copyright © 2010 Pearson Education, Inc. Unit 3: Gathering Data Chapter 11 Understanding Randomness.
Programming With Java ICS201 University Of Hail1 Chapter 12 UML and Patterns.
Working with Numbers in Alice - Converting to integers and to strings - Rounding numbers. - Truncating Numbers Samantha Huerta under the direction of Professor.
Moodle (Course Management Systems). Assignments 1 Assignments are a refreshingly simple method for collecting student work. They are a simple and flexible.
Study Guide For Test Chapter 5, 6,& 7 Test is Friday, May 15th.
MOM! Phineas and Ferb are … Aims:
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
Week 5 - Monday.  What did we talk about last time?  Linked list implementations  Stacks  Queues.
A1 Visual C++.NET Intro Programming in C++ Computer Science Dept Va Tech August, 2002 © Barnette ND & McQuain WD 1 Quick Introduction The following.
Passing Other Objects Strings are called immutable which means that once a String object stores a value, it never changes –recall when we passed a message.
Chapter 1 - Getting to know Greenfoot
VB Games: Preparing for Memory Brainstorm controls & events Parallel structures (again), Visibility, LoadPicture, User-defined procedures, Do While/Loop,busy.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Microsoft ® Office Excel 2003 Training Using XML in Excel SynAppSys Educational Services presents:
The challenge of poker NDHU CSIE AI Lab 羅仲耘. 2004/11/04the challenge of poker2 Outline Introduction Texas Hold’em rules Poki’s architecture Betting Strategy.
AP STATISTICS Objective: Understanding Randomness Do Now: Take out any completed contracts, personal profiles, as well as your written design study. HW:
Visual Basic Games: Week 4 Recap Parallel structures Initialization Prepare for Memory Scoring Shuffling Homework: when ready, move on to next game/chapter.
Game Maker – Getting Started What is Game Maker?.
1 FUNCTIONS - I Chapter 5 Functions help us write more complex programs.
Build-A-Button Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Wednesday, October 8, 2003.
Neural Network Implementation of Poker AI
UNIT 5.  The related activities of sorting, searching and merging are central to many computer applications.  Sorting and merging provide us with a.
M1G Introduction to Programming 2 5. Completing the program.
M1G Introduction to Programming 2 3. Creating Classes: Room and Item.
Author Ivan Dominic Baguio. ABOUT THE GAME Game Objective  The goal of each player in the game is to discard all cards in his hand before every other.
CHAPTER 14 Classes, Objects, and Games XNA Game Studio 4.0.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Craps Game Application Introducing Random-Number Generation and Enum.
8.1 8 Algorithms Foundations of Computer Science  Cengage Learning.
CSE 403 Lecture 8 UML Sequence Diagrams Reading: UML Distilled, Ch. 4, M. Fowler slides created by Marty Stepp
COM148X1 Interactive Programming Lecture 8. Topics Today Review.
Introduction to JavaScript Events Instructor: Sergey Goldman 1.
CONDITIONALS CITS1001. Scope of this lecture if statements switch statements Source ppts: Objects First with Java - A Practical Introduction using BlueJ,
Fundamentals of Windows Mouse n 4 Basic Operations: –Pointing –Clicking –Double Clicking –Dragging.
Власенко Юлия Сергеевна, учитель математики МОУ ООШ №5 г. Качканар
POKER-6S ooA, OOD, OOP.
User-Written Functions
UML UML Sequence Diagrams CSE 403
Test Information Distribution Engine (TIDE)
Mostly Solving Equations
This is a setup file for a Jeopardy game.
Calculus Jeopardy Hosted by Bannon Welcome to Power Jeopardy
This is a setup file for a Jeopardy game.
Introduction to Data Structure
This is a setup file for a Jeopardy game.
CSE 373 Data Structures and Algorithms
Степень с натуральным показателем
This is a setup file for a Jeopardy game.
Presentation transcript:

Ikhan McClarty Devin Gaines Graham Gimbert James Cefaratti Kwang Kim Monarch Shah Exploration of Design Alternatives

Graphic User Interface Ikhan McClarty

Confirmation boxes  void confirmClose() This method is called if the player chooses to close without saving and after the confirmation proceeds to close or gives the player the option to save  void confirmOverwiteSave() This method is called if the player chooses to save using a filename that already exists It either cancels the command or proceeds to overwrite the already present file

Confirmation boxes Cont’d  void confirmLoadGame() This method is called if there is a game currently in progress and the player asks to load a saved game It then gives the player the option to load the game or cancel the request

Table Features Monarch Shah

Table Features Functionality:  Includes ongoing action on the table  Mainly it’s just a conversation bubble  Bubble will pop next to the player Icon.  Snap shot of this is shown below.

Different Kind’s of bubble includes Check, Raise, Fold, Call, Flop, Turn, River. Shown Below:

Functionality:  Going to Use C and Allegro for coding.  Idea is whenever user select “check” button, check bubble will pop up for particular player.  Its going to communicate with all the buttons, and going to respond accordingly.  Only active when some particular action calls them and respond to this action.  Disabled Rest of the time.

Implementation:  Table Features Class  showBubble (playerName, selectedButton button);  Interacts with both player and button so both attributes are needed in this function.  hideBubble (playerName, selectedButton button);  Flop, turn and river bubbles are not associated with player, they are associated with table so they will have table attributes.

Player/Player Icons:  You can choose from 20 given Icons and computer will be given icons randomly.  It will Look something like this:

Computer Playing Intelligence Kwang Kim

Function Implementation  Each player has all the same functions in order to play.  These include call, bet, raise, fold, check, pre- flop strategy, post-flop strategy.  How to implement?

Implementation  Create a hierarchy of classes.  Superclass is a general player, includes all the functions.  Function specifications are described in each subclass: weak, tight, aggressive.

Function Specification  Functions which are used in each style. void preFlop() //execute preflop strategy void postFlop() //execute postflop strategy int getHandRanking(Hand h) //returns strength of a hand void check() //do nothing, action passed to next player in hand

Function Specification void callBet(Bet b) //call b amount of chips void bet() //bet fixed amount of chips void raise(Bet b) //bet b + fixed amount of chips void fold() //surrender hand

Function Specification bool inHand() //return true if player is in the hand void showDown() //show cards at showdown end of hand void updateChips(int x) //update chip count by x int getChipCount() //return number of chips player has

Implementation Plan  Superclass has definitions for the following functions: call, bet, raise, fold, check, getHandRanking, inHand, showDown, getChipCount, updateChips.  The only functions needed in the subclass are pre- flop and post-flop strategy.

Button Functionality James Cefaratti

Button Class class Button Public:  getX();  getY();  setX(int newX);  setY(int newY);  setSkin(BITMAP* putSkin);

Button Class (cont.) Public:  getHeight();  getWidth();

Point of Functions Should be able to move the button anywhere on the screen using the setX and setY Should be able to get the button’s x and y coordinates and the height and width value to tell if the mouse is over the button If the mouse is over the button and the mouse button is pressed, another function can be called

Save/Load Feature This will be a function in the main class that stores information about the current game and saves it / reads it from a file When “Save Game” is clicked on the screen the current game values such as player name, player chip count, button holder, pot size, etc… will be saved to an array or arrays

saveGame Signature void saveGame(String[] names, int[] values)  Save to a file in some logical order

loadGame Signature First the game screen will have to be loaded and setup then function should be called to setup the game exactly how it was Void loadGame()  Read values in from the file, the order of the values is known so the game can be setup corresponding to those values

Sample Player Data File James 5 10,000 True A, hearts ; A, spades Player Name Position at table Player Chip Count Button Current Hand

Sample Computer Data John false Jill false Ryan false Sarah False 500 Computer Player Name Position at Table Chip Count Button Computer Player Name Position at table Chip count Button Computer Player Name Position at Table Chip Count Button Computer Player Name Position at Table Chip Count Button Pot Size

Best Hand Algorithm Graham Gimbert

Store and sort via a Bi-directional doubly-linked lists  Using the lists check for things such as cards of equal value, same suit, incrementing value, and high cards

class Cardnode { private: Cardnode *next; Cardnode *prev; Cardnode *down; Card *data; public: Cardnode* getNext(); Cardnode* getPrev(); Cardnode* getDown(); Card* getData(); void setNext(Cardnode *temp); void setPrev(Cardnode *prev); void setDown(Cardnode *temp); Cardnode (Card *temp, Cardnode *tnext, Cardnode *tprev, Cardnode *tdown); }

class Cardlist { private: Cardnode *head; int size; public: Cardnode* getHead(); Cardnode* getNext(Cardnode *temp); Cardnode* getPrev(Cardnode *temp); Cardnode* getDown(Cardnode *temp); int getSize(); void insert(Cardnode *temp); Cardlist(); }

class Hand { private: Card *first; public: void addCard(Card *temp); Card* getFirstCard(); Card* getNextCard(Card *temp); Hand(); }

class BestHand { private: Cardlist *numberList; Cardlist *suitList; Hand *receivedHand; Hand *bestHand; void parseNumbers(); void parseSuits(); public: Hand* getBestHand(); BestHand(Hand *toBeSorted); }

Shuffling & AI Functions Devin Gaines

Where to Begin… The main question that I am posing to this part of the project is “what makes a good shuffling randomizer?” After tossing around a few ideas, some of the qualities needed for this shuffling program to work are… Reliability of Randomness  Is the function creating truly random numbers and are they being nicely distributed among the cards? Efficiency of Code  Is the code efficient enough for the program not to lag? Repetitive of Randomization  Can this shuffling function be easily used during each hand?

Methods In Creating a Shuffling Function Currently, I’m playing around with different randomization formats for the shuffling program. One of the first ideas was developing a simple ordered deck. It seems fairly realistic in terms of the shuffling mechanism and it’s really clear cut as far as coding.

Random Ordered Shuffling void shuffle(Card *playDeck)/*basic coding*/ { for(int i=0; i<52; i++) { int j=rand() % 52; Card temp = playDeck[i]; playDeck[i] = playDeck[j]; playDeck[j] = temp; }

Advantages and Disadvantages This method is more traditional and simple in coding. Also it allows for random numbers to be first produced and then cards are randomly placed in accordance to their random number. The good thing about this type of code is that it allows for the shuffle to simulate how we, as humans, really shuffle.  We do a simple swap to the cards in terms of positions. So a top card might be then place towards the bottom of the deck or maybe somewhere in the middle, who knows? The problem, though, with this idea is that it relies too heavily on randomizing technique, but it’s not entirely reliable as a good randomizer.

Another Method Look Up Table  This solution involves simple assigning a random number to each card, and then picking cards out by random numbers.  There is a chance that two of the cards are assigned the same number. This can be checked each time you assign a number, or even better this can be checked when you sort the cards. If two cards are assigned to the same number, then one could either assign the next number or choose another random number to be assigned to the card.  This would form a lookup table each hand and have a card linked with a particular random number.

Look Up Method Functions Assignment Function /*Assigning a random number to a certain card */ Declare variables for DECK_SIZE and a CARD ID; Declare an array CARD_ASSIGNED From 0 to DECK_SIZE cardID = (rand()%DECK_SIZE); /* Get rand numbers between 0 and 51 */ if(cardID == any of the previous number in CARD_ASSIGNED array) card1 = (rand()%DECK_SIZE); /*repeat finding a new number*/ else when we find a new number, hold this number is CARD_ASSIGNED array and continue distributing the rest of the numbers out.

Look Up Method Functions Sorting Function (Bubble Sort) int flag = 1; // set flag to 1 to begin initial pass From 0 to DECK_SIZE { flag = 0; From 0 to DECK_SIZE – 1 if (random CardID x > random CardID y) { Swap CardID in ascending order flag = 1; // indicates that a swap occurred. }

Look Up Method Functions From here, all we would then need to do is have a ChooseRand() function to choose a random number for each player when picking a card at the beginning of each round. Some of the benefit with this type of code would be the fact that we could easily pull information out at random. The only problem with this method is when programming it we rely heavily on the rand() function for choosing a good random number. This is problematic because some random number generators like rand(), have bias on some of bits in a number. This makes the rand() function semi-predictable.

Look Up Method A possible solution…I’m still playing around with that. But I’m looking into playing with weighted arrays and random functions to see if that makes the rand() function less predictable.

AI Functions I’m also working on part of the AI player functions for one of template styles that the players will be going up against. I’m personally in charge of the weak style strategy and I been contemplating a few ideas for a few functions needed to create this player style.

Player Modules I want to make the function very much related to how actual players would take in and process information, so I will most likely use the following function…  STIMULUS() //Defines the weak player’s betting style…when they’ll be likely to raise or fold  RESPONSE() //A response to a player’s action in the game  JUDGE_WEAK() //A statistical function that takes in the stimulus and formulates whether the player should bet, how much they should bet, or if to fold.  STATS_WEAK() //Function carries all the likelihoods that they will bet, fold, raise, etc.