Before we launch into this assignment, let’s take a look at the solution for assignment 5:

Assignment #6 – Fun with Enums

In this assignment we are going to use our knowledge of Enums to create a Texas holdem poker game!

If you aren’t familiar with Texas holdem poker, you can become acquainted with the generic rules of poker here.

Assignment #6 – Fun with Enums. In this assignment we are going to use our knowledge of Enums to create a Texas holdem poker game! If you aren’t familiar with Texas holdem poker, you can become acquainted with the generic rules of poker here. Check for updates.

Javascript

Javascript Texas Holdem Poker

This particular assignment won’t be to implement the entire breadth of the game, but rather, to implement the key elements of the game of poker so that we can expand on it later. So let’s talk about the elements that you’ll need to implement for this assignment.

You are required to create a Deck of Cards that can be used in our poker game. The deck should be a standard deck of cards consisting of 52 cards made up of 4 different Suits (diamonds, clubs, hearts, spades) with Values ranging from TWO to ACE.

Once you have your Deck of cards setup, the next thing you need to do is be able to:

  • Shuffle your deck
  • Deal cards to Players

Having said that, you will also need to create Players, these players will have one Hand of cards. Each hand will consist of two distinct cards from the deck.

Not only do you need to deal cards to players, but you also need to deal the “community cards”. For this iteration of the assignment, let’s just deal five community cards right away. I don’t want to put the “betting” aspect into this assignment just yet.

Once you have dealt all players their hands (two cards each), and you have dealt the five community cards, then you’ll need to figure out which player has the best hand. To do this, you’ll need to know which type of hand beats another, so here’s the list:


(picture credit goes to www.betshoot.com)

You’ll need to output each players’ hand in the console window, as well as the community cards. Once you determine which player is the winner, you should output which player won and with what hand. In the event that there is a tie (i.e. two players hold the same winning hand), you’ll need to determine which of the winning hands has the higher value cards. So if both players have three of a kind, then the player with the three higher value cards wins (i.e. Player 1 has three jacks, but Player 2 has three aces… aces > jacks therefore Player 2 wins).

A draw will occur only if the values of the winning hands are exactly the same (i.e. two players have three of a kind with kings and identical ‘non-winning’ cards)… In the event that two players each have the same winning cards, but different non-winning cards (i.e. Player1 has three aces a king and a jack, Player2 has three aces, a jack and a four), then the player with the higher “kicker” card wins (i.e. Player1 wins because their king kicker beats Player2’s jack kicker).

Note: This assignment is more difficult than most other assignments I have posted on this blog. It took me roughly 12 hours of coding to complete this assignment. The good news for you is that I have included a good chunk of the coding in the assignment source files that you can download below.

What You’ll Learn

This assignment should make heavy use of Data Structures, namely Lists and Maps. Everybody’s solution will be different, so if you don’t use these data structures, then no worries… However, I do believe you will need to use them to make your life a little easier.

You will also learn how to Sort Collections, this will be mandatory, as it will be very difficult to determine which player has won without being able to sort the cards.

My solution even uses a little Recursion, now whether or not you choose to do this is up to you, but I believe it made my solution simpler.

Holdem

Click Here to View the Assignment Files on GitHub

Also, here’s the GitHub Clone URI: https://github.com/tp02ga/JavaPracticeAssignment6.git

PHP Poker is packed full of features including player statistics, custom avatars, live game chat, administrator control panel, high scores leaderboard, sit ‘n go & tournament tables,
adjustable buy in limits and much more.

Try our Live Demo Today & Secure Your Copy!

Easy To Setup And Configure

As we install and set up PHP Multiplayer Texas Hold’em Poker for you, there is no need for you to have any previous website experience.
This makes our software ideal for individuals, groups of friends, businesses, clubs or anyone
who wants to say they own a Live Online Multiplayer Poker Website!

With no annoying downloads or software to install, your visitors can create a character and start playing straight away.

Game Features

  • Virtually Unlimited Table Creation allows a wide scope of use from small groups to high traffic websites.
  • Game Lobby System the live lobby lets you browse and join existing tables or create a new table for others to join.
  • Instant Live AJAX Gameplay delivers fast, low bandwidth, gameplay and is compatible with all modern browsers. There is no download necessary for your members and the only requirement is that they have Javascript enabled on their computer.
  • High Scores, Stats & Rankings make the game more enjoyable long term. Players can view their progress as they rise up through the ranks and have the opportunity to analyse their game play via their personal win ratios and move statistics.
  • Custom Avatars (players photos) can be uploaded by players to give that personal touch to their game character.
  • Live Chat Module allows players to interact with one another, whilst in a game or just hanging out in the lobby.
  • Table Types include an adjustable buy in limit, open or locked tables and increasing blinds.

Admin Features

  • 3 Approval Modes allow you to either auto approve all new players, approve them after verifying their email address or approve them manually in the admin panel.
  • Banning Players is easy with our handy ban/unban feature. At the click of a button you can instantly kick any player from your site on a temporary or permanent basis.
  • Resetting Players Stats can be done with the click of a button so you can reset accounts upon request if a player wishes to start afresh.
  • Game timers can be altered to allow the administrator to adjust the speed of game play. You can adjust the player move timer, the length of time the hands display at the showdown and also the kick timer that will auto kick inactive players.
  • Optional Login Override settings allow you to utilise an existing session based membership login system to bypass our login system.

PHP Poker is an online multiplayer Texas Hold’em poker game that you can purchase to install and run on your own web server. The game script has been written in a mixture of PHP, MySQL, Ajax and JS.

Our multiplayer poker script is easy to install and set up. We also offer a installation service (excl. integration) so there is no need for you to have any previous website experience. Our software ideal for individuals, groups, friends, businesses, clubs, advertising agencies, webmasters and entrepreneurs who wish to offer Live Online Multiplayer Poker on their website.

Each installation of PHP Poker can handle a virtually unlimited amount of live tables* and utilises a game lobby system so visitors can create new tables or browse and join existing tables.When you buy our package you get your very own, ready to play complete online game system so you can play poker and chat with your friends, colleagues or other players from around the world. Your online site can be open to the public or closed for private play.

Javascript Texas Holdem Strategy

With no annoying downloads or software to install, your visitors can create a player account and start hustling straight away. The PHP Poker game script is cross browser friendly and will work with most popular javascript enabled browsers (IE, Firefox, Netscape, Opera).

Coments are closed
Scroll to top