Package org.ozsoft.texasholdem

Examples of org.ozsoft.texasholdem.Card


    /**
     * Tests the implementation of the Chen formula calculator.
     */
    @Test
    public void chenFormula() {
        Card card1 = null;
        Card card2 = null;
       
        card1 = new Card(Card.ACE, Card.SPADES);
        card2 = new Card(Card.ACE, Card.HEARTS);
        Assert.assertEquals(20.0, PokerUtils.getChenScore(new Card[] {card1, card2}), DELTA);

        card1 = new Card(Card.ACE, Card.SPADES);
        card2 = new Card(Card.KING, Card.SPADES);
        Assert.assertEquals(12.0, PokerUtils.getChenScore(new Card[] {card1, card2}), DELTA);

        card1 = new Card(Card.KING, Card.SPADES);
        card2 = new Card(Card.KING, Card.HEARTS);
        Assert.assertEquals(16.0, PokerUtils.getChenScore(new Card[] {card1, card2}), DELTA);

        card1 = new Card(Card.TEN, Card.CLUBS);
        card2 = new Card(Card.TEN, Card.DIAMONDS);
        Assert.assertEquals(10.0, PokerUtils.getChenScore(new Card[] {card1, card2}), DELTA);

        card1 = new Card(Card.FIVE, Card.CLUBS);
        card2 = new Card(Card.SEVEN, Card.CLUBS);
        Assert.assertEquals(6.0, PokerUtils.getChenScore(new Card[] {card1, card2}), DELTA);

        card1 = new Card(Card.DEUCE, Card.CLUBS);
        card2 = new Card(Card.SEVEN, Card.DIAMONDS);
        Assert.assertEquals(0.0, PokerUtils.getChenScore(new Card[] {card1, card2}), DELTA);
    }
View Full Code Here

TOP

Related Classes of org.ozsoft.texasholdem.Card

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.