All Packages Class Hierarchy This Package Previous Next Index
Class com.lotspiech.poker.SingletonCalculator
java.lang.Object
|
+----com.lotspiech.poker.SingletonCalculator
- public class SingletonCalculator
- extends Object
This is used to calculate the number of cards remaining
in the deck, not counting pairs, three-of-a-kind, etc.
- Author:
- Jeffrey B. Lotspiech
-
COPYRIGHT
-
-
fromDeck
-
-
have
-
-
nonSingleton
-
-
table
-
-
SingletonCalculator(int[], int[], int)
- This creates a singleton calculator.
-
allSingletons()
- This method was created in VisualAge.
-
count(int, int, int)
- This returns all the ways of getting singletons in the remaining cards in the
deck, beginning with a certain rank, and going lower (in card value).
COPYRIGHT
private static final String COPYRIGHT
table
private int table[]
have
private int have[]
fromDeck
private int fromDeck[]
nonSingleton
private int nonSingleton
SingletonCalculator
public SingletonCalculator(int have[],
int fromDeck[],
int maxDraw)
- This creates a singleton calculator.
- Parameters:
- have - The ranks in the hand.
- fromDeck - The ranks remaining in the deck.
- maxDraw - Maximum number of draws. This is not used now, but could be
used for further pre-calculations.
allSingletons
public boolean allSingletons()
- This method was created in VisualAge.
- Returns:
- boolean
count
public int count(int startingRank,
int exclude,
int draw)
- This returns all the ways of getting singletons in the remaining cards in the
deck, beginning with a certain rank, and going lower (in card value).
- Parameters:
- rank - Rank to start with.
- exclude - One rank to exclude, or -1.
- draw - Cards to be drawn.
- Returns:
- Count.
All Packages Class Hierarchy This Package Previous Next Index