Skip to content

johnnyhsu1106/poker-games-in-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

poker-in-Java

Design poker game based on Design Pattern in Java

This zip file contains 80 Java files including .java file and .class files. Each .java file corresponds to one .class file. Each.java or .class file represents a Java class. Before you run it, you can use command prompt or Java IDE to run this code. Execute the file: PokerGameDemo.class on the command prompt by typing the following command. For example, in Windows > java PokerGameDemo

This project is finished collaboratively by four MIS students in University of Arizona . (listed alphabetically)

Project Summary:

We have designed a poker game. We developed a program to compute the relative strength of poker hands based on a set number of players and following the rules of various poker game variations. This program will generate a complete deck of cards by suit and face-value as well as track the hands of each “player” in the game. We wanted to ensure this program is extensible so that additional game variations can be added and scalable by allowing more players to be added to the game. We also wanted to make sure that betting and AI players could eventually be programmed into the program.

    File Description

    PokerProject.mp4 - a video demos how it works in terminal Final Report.docx - describe how

    Design Patterns:

    1. Bridge (2): We used the bridge pattern when to structure poker tables as either tournament or cash tables and to structure the betting pattern for each table as either no limit or limit poker. We also used a bridge to ensure that AI players can be set up with betting tolerance of loose or tight and with a style of aggressive, neutral, or passive.
    2. Strategy (several): We use multiple strategies throughout the design. We have a poker game strategy that chooses between Texas Hold ‘Em, 7 Card Stud, 5 Card Draw, and Omaha. We employ strategy to create players as either Human or AI. We use strategy for a list of dealers that corresponds to the list of poker games.
    3. Observer (1): The implementation of an observer pattern will notify the Player class, after they join a Table, that the Dealer has dealt a card to either the player’s hand or the community hand. The Player class’ notify method will call PokerHand’s updateBestHand() method to create the player’s best hand based on their hand and the community’s hand.
    4. Abstract Factory (1): The abstract factory will bundle Table, Dealer, Player, BettingStructure, and GameType objects when a poker game instance is created.

    Key Features:

    The program will deal out cards, compare player hands, and designate a winner for a selected poker game variation. We have set up some basic rules relating to the number of cards given to and shared by players for a select variety of poker games variations. This can be extended to include other game types.

    Currently, betting and AI players are not programmed into the code, but we have the structure to ensured that there is space for the required algorithms to be easily inserted.

    All .java and .class files are listed below.

    AggroStyle.java
    AIPlayer.java
    BettingStructure.java
    BettingStructure Factory.java
    Card.java
    CashGame.java
    CommunityCard.java
    Dealer.java
    DealerFactory.java
    Deck.java
    DrawDealer.java
    FiveCardDraw.java
    GameType.java
    GameTypeFactory.java
    HandStrengthAnalyzer.java
    HoldemDealer.java
    HumanPlayer.java
    Limit.java
    LoosePlayer.java
    NeutralStyle.java
    NoLimit.java
    Omaha.java
    OmahaDealer.java
    PassiveStyle.java
    Player.java
    PlayerFactory.java
    PlayerHand.java
    PlayerStyle.java
    PokerFactory.java
    PokerGame.java
    PokerDemo.java
    PokerGameFactory.java
    PokerHand.java
    SevenCardStud.java
    StudDealer.java
    Table.java
    TableFactory.java
    TexasHoldEm.java
    TightPlayer.java
    TournamentGame.java

About

Design poker game based on design pattern in Java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages