Need a JAVA class - Poker Hand Evaluator

Discussion in 'Programming' started by sllik, Oct 21, 2008.

  1. #1
    Hi, I need a Java class that will evaluate a 7 card holdem poker hand. Here are the requirements:

    Class name: Hand
    Constructor: public Hand(ArrayList<Integer> cards) - where cards is the ArrayList of 7 cards (1 -52).

    The cards are represented like so:
    1 - 13:2 - A of Hearts
    14 - 26:2 - A of Diamonds
    27 - 39:2 - A of Clubs
    40 - 52:2 - A of Spades.

    Required Methods:
    * public int value() - returns int value of the hand. Totaly up to you how you evaluate that. This method will be used for hand comparison (if hand1.value() > hand2.value() then hand1 is better than hand2).

    * public ArrayList<Integer> bestHand() - returns the 5 cards that make up the best possible hand.

    * public String toString() - returns the name of the best possible hand (high card, pair, two pair, three of a kind, straight, flush, full house, four of a kind, straight flush, royal flush)

    This class should be tested by comparing the following hands:
    Set 1:
    8c,2d,5s,9d,Ah,3h,4h - expected winner (straight)
    8c,2d,5s,8d,8h,3h,4h

    Set 2:
    8C,2D,5S,9D,AH,3H,4H
    Ks,9h,10d,Jh,Ah,Qd,8d - expected winner (ace high straight)
    Ks,9h,10d,Jh,2h,Qd,8d

    Set 3:
    8C,2D,5S,9D,AH,3H,4H
    Ks,9h,10d,Jh,Ah,Qd,8d
    Ks,9s,10s,Js,2h,Qs,8d - expected winner (straight flush)

    Set 4:
    Qs, Qc, 3s, 3c, Ac, Ad, 9c
    Qs, Qc, 3s, 10c, Ac, Ad, 9c - expected winner (two pair with a 10 high)

    Set 5:
    Qs, Qc, 3s, 3c, Ac, Ad, 9c
    Qs, Qc, 3s, As, Ac, Ad, 9c - expected winner (full house)

    If interested in taking this job, please message me with your price. Thanks!
     
    sllik, Oct 21, 2008 IP
  2. sllik

    sllik Active Member

    Messages:
    419
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    still looking...
     
    sllik, Oct 22, 2008 IP
  3. stickycarrots

    stickycarrots Peon

    Messages:
    4,513
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    How much are you willing to pay?
     
    stickycarrots, Oct 22, 2008 IP
  4. UAA

    UAA Active Member

    Messages:
    624
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    58
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    is it for Java SE?
     
    UAA, Oct 22, 2008 IP
  5. sllik

    sllik Active Member

    Messages:
    419
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    just send me your quote
     
    sllik, Oct 22, 2008 IP
  6. sllik

    sllik Active Member

    Messages:
    419
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    yes it's standard edition version 6
     
    sllik, Oct 22, 2008 IP
  7. firmaterra

    firmaterra Peon

    Messages:
    756
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #7
    Sent you a PM on this.
     
    firmaterra, Oct 22, 2008 IP
  8. sllik

    sllik Active Member

    Messages:
    419
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #8
    still looking... :)
     
    sllik, Oct 24, 2008 IP
  9. daman371

    daman371 Peon

    Messages:
    121
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #9
    I sent you a pm and you never responded. Oh. I use a special class for it but it doesn't matter too much. It's just for output and input.
     
    daman371, Oct 27, 2008 IP