Thread Rating:

ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6691
Joined: Jun 22, 2011
August 26th, 2016 at 6:13:51 PM permalink
I seem to recall somebody asking a while ago if there was an "easy" way to map the 2,598,960 different possible 5-card hands into the 134,459 "unique" 5-card hands (the ones that took suits into account, but didn't depend on "specific" suits - for example, 3,5,7,9 of spades and 3 of diamonds is the same as the other 11 hands that are 3,5,7,9 of any suit and 3 of any other suit).

The answer, as far as I know, is, "No, there's no 'easy' way; it has to be done by brute force." In fact, I find that it is easiest to build the table of unique hands while you are doing the mapping of the 2,598,960 hands.

Here is some slightly modified C# code that generates both the "unique hands" and maps all of the 5-card hands to them.

However, the full code is too long to fit into a single post, so it will be broken up into sections; each section will be added as a reply within this post

Part 1 - Definitions


A few definitions:

Each card is represented by a number from 0 to 51; the number divided by 4 (and rounded down) represents the rank, and the number modulo 4 represents the suit. Technically, the ranks do not have to be in order, but I like to use 0-3 = Ace, 4-6 = Two, and so on, through 48-51 = King.
Each 5-card hand is converted to a unique number from 0 to 2,598,959. The way to do this with cards numbered 0-51 is:
Index = (52)C(5) - (52-X1)C(5) + (51-X1)C(4) - (52-X2)C(4) + (51-X2)C(3) - (52-X3)C(3) + (51-X3)C(2) - (52-X4)C(2) + (51-X4) - (52-X5)
where (A)C(B) is the number of combinations of A elements taken B at a time (also written as combin(A,B))

AllHands[2598960] is an array that holds each hand's unique hand index

UniqueHands[134459][3] is an array for each unique hand; column 0 holds a pointer to the pay table (which I won't get into right now, but, for Jacks or Better, it is usually something like 0 = lose, 1 = high pair, 2 = two pair, ..., 9 = royal flush), column 1 holds the number of AllHands[ ] hands that point to this row, and column 2 holds a pointer to an AllHands[ ] row that points back to this row. (The latter two are useful when calculating the game's expected return.)

Combin[53][6] is a table that holds the combination values - i.e. Combin[A] = (A)C(B). It is much faster to "calculate" combinations this way than by actually calculating them when needed.

ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6691
Joined: Jun 22, 2011
August 26th, 2016 at 6:14:24 PM permalink
Here are the functions and global variables used in the main code section:

GetID takes five card values and returns the 0-2598959 index of the hand

GetUniqueHand takes five card values, assigns it to the next available row in UniqueHands[ ], and returns that value so that the code that called the function can
then assign the UniqueHand value to other hands; this is why it is easiest to determine the unique hands while mapping the full set of hands to them.
If you look at the code, you will notice that UniqueHands[UniqueID, 2] is always set to 1. In reality, it would be set to a value based on the game being
played, and there would be additional code - most likely a function - that determines the hand from the cards (e.g. 0 1 2 3 4 is four aces; 0 36 40 44 48 is a royal flush).
There would be another table called PayTable which holds the pay values; this is separate to make it easier to change the pay values without
having to change too many values in arrays. For example, if PayTable[7] represented four of a kind, its value could be 25, and all of the UniqueHands
rows that represent a four of a kind would have their column 2 values set to 7 to point to it.

Part 2 - Global Variables and Functions


private int[] AllHands = new int[2598960];
private int[,] UniqueHands = new int[134459, 3];
private int UniqueID;
private int[,] Combin = new int[53, 6];

// Variables used in GetID but declared public so they're not dropped
// and recreated each time GetID is called
private int[] H = new int[5];
private int A, B, Z;

private int GetID(int C1, int C2, int C3, int C4, int C5)
{
int ReturnValue = -1;

// Sort the five numbers
H[0] = C1;
H[1] = C2;
H[2] = C3;
H[3] = C4;
H[4] = C5;
for (A = 0; A < 4; A++)
{
for (B = A + 1; B < 5; B++)
{
if (H[A] > H)
{
Z = H[A];
H[A] = H;
H = Z;
}
}
}
ReturnValue = Combin[52, 5] - Combin[52 - H[0], 5]
+ Combin[51 - H[0], 4] - Combin[52 - H[1], 4]
+ Combin[51 - H[1], 3] - Combin[52 - H[2], 3]
+ Combin[51 - H[2], 2] - Combin[52 - H[3], 2]
+ (51 - H[3]) - (52 - H[4]);
return ReturnValue;
}

private void GetUniqueHand(int C1, int C2, int C3, int C4, int C5, int NumHands)
{
UniqueID++;
A = GetID(C1, C2, C3, C4, C5);
AllHands[A] = UniqueID;
UniqueHands[UniqueID, 2] = A;
UniqueHands[UniqueID, 1] = NumHands;
UniqueHands[UniqueID, 0] = 1;
}

ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6691
Joined: Jun 22, 2011
August 26th, 2016 at 6:15:10 PM permalink
And now for the main event - er, main code. This is broken up into sections to make it easier to read (and post).

Part 3 - four of a kinds, and full houses


private void main()
{
// Initialize the Combination table
for (int A = 1; A <= 52; A++)
{
Combin[A, 0] = 1;
for (int B = 1; B <= 5; B++)
{
Combin[A, B] = Combin[A, B - 1] * (A + 1 - B) / B;
}
}

for (int N = 0; N < 2598960; N++)
{
AllHands[N] = -1;
}
UniqueID = -1;

int C1, C2, C3, C4, C5;

// 4-1
for (C1 = 0; C1 < 13; C1++)
{
for (C2 = 0; C2 < 13; C2++)
{
if (C1 != C2)
{
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , 4);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 3)] = UniqueID;
}
}
}

// 3-2
for (C1 = 0; C1 < 13; C1++)
{
for (C2 = 0; C2 < 13; C2++)
{
if (C1 != C2)
{
// Both suits in the 2 also in the 3
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C2 * 4 + 1, 12);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C2 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C2 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C2 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C2 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C2 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C2 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C2 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C2 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C2 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C2 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C2 * 4 + 3)] = UniqueID;
// One suit in the 2 not in the 3
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C2 * 4 + 3, 12);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C2 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 2, C2 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C2 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C2 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 3, C2 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C2 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C2 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 3, C2 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C2 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C2 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 3, C2 * 4 )] = UniqueID;
}
}
}

ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6691
Joined: Jun 22, 2011
August 26th, 2016 at 6:15:41 PM permalink
Part 4 - threes of a kind, and two pairs


// 3-1-1
for (C1 = 0; C1 < 13; C1++)
{
for (C2 = 0; C2 < 12; C2++)
{
if (C2 != C1)
{
for (C3 = C2 + 1; C3 < 13; C3++)
{
if (C3 != C1)
{
// Two 1s suited, in the 3
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C3 * 4 , 12);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3)] = UniqueID;
// Two 1s suited, not in the 3
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, 4);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C3 * 4 )] = UniqueID;
// Two 1s unsuited, both in the 3
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, 24);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 2, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 3, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 3, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2)] = UniqueID;
// Two 1s unsuited, first in the 3
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, 12);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 3, C3 * 4 )] = UniqueID;
// Two 1s unsuited, second in the 3
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , 12);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C3 * 4 + 3)] = UniqueID;
}
}
}
}
}

// 2-2-1
for (C1 = 0; C1 < 12; C1++)
{
for (C2 = C1 + 1; C2 < 13; C2++)
{
for (C3 = 0; C3 < 13; C3++)
{
if (C3 != C1 && C3 != C2)
{
// Pairs have the same suits; 1 is one of these suits
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C2 * 4 , C2 * 4 + 1, C3 * 4 , 12);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 , C2 * 4 + 1, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C2 * 4 + 2, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C2 * 4 + 2, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C2 * 4 + 3, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C2 * 4 + 3, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3)] = UniqueID;
// Pairs have the same suits; 1 is not one of these suits
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C2 * 4 , C2 * 4 + 1, C3 * 4 + 2, 12);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 , C2 * 4 + 1, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C2 * 4 + 2, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C2 * 4 + 2, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C2 * 4 + 3, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C2 * 4 + 3, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C2 * 4 + 2, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C2 * 4 + 3, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C2 * 4 + 3, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1)] = UniqueID;
// Pairs have 1 card matching suit; 1 is in both pairs
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C2 * 4 , C2 * 4 + 2, C3 * 4 , 24);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 , C2 * 4 + 3, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C2 * 4 + 1, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C2 * 4 + 3, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C2 * 4 + 1, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C2 * 4 + 2, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C2 * 4 , C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C2 * 4 , C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C2 * 4 , C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C2 * 4 , C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C2 * 4 , C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C2 * 4 , C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3)] = UniqueID;
// Pairs have 1 card matching suit; 1 is in only the first pair
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C2 * 4 , C2 * 4 + 2, C3 * 4 + 1, 24);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 , C2 * 4 + 3, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C2 * 4 + 1, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C2 * 4 + 3, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C2 * 4 + 1, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C2 * 4 + 2, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C2 * 4 + 2, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C2 * 4 + 3, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C2 * 4 , C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C2 * 4 , C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C2 * 4 + 1, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C2 * 4 + 3, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C2 * 4 , C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C2 * 4 , C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C2 * 4 + 1, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C2 * 4 + 2, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C2 * 4 , C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C2 * 4 , C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2)] = UniqueID;
// Pairs have 1 card matching suit; 1 is in only the second pair
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C2 * 4 , C2 * 4 + 2, C3 * 4 + 2, 24);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 , C2 * 4 + 3, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C2 * 4 + 1, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C2 * 4 + 3, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C2 * 4 + 1, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C2 * 4 + 2, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C2 * 4 , C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C2 * 4 , C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C2 * 4 , C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C2 * 4 , C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C2 * 4 , C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C2 * 4 , C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1)] = UniqueID;
// Pairs have 1 card matching suit; 1 is in neither pair
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C2 * 4 , C2 * 4 + 2, C3 * 4 + 3, 24);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 , C2 * 4 + 3, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C2 * 4 + 1, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C2 * 4 + 3, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C2 * 4 + 1, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C2 * 4 + 2, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C2 * 4 , C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C2 * 4 + 3, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C2 * 4 , C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C2 * 4 + 2, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C2 * 4 , C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C2 * 4 + 3, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C2 * 4 , C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C2 * 4 + 1, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C2 * 4 , C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C2 * 4 + 2, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C2 * 4 , C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C2 * 4 + 1, C3 * 4 )] = UniqueID;
// Pairs have no matches in suits; 1 is in first pair
GetUniqueHand (C1 * 4 , C1 * 4 + 1, C2 * 4 + 2, C2 * 4 + 3, C3 * 4 , 12);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 1, C2 * 4 + 3, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 1, C2 * 4 + 2, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C2 * 4 + 3, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C2 * 4 + 3, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C2 * 4 + 2, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C2 * 4 + 2, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C2 * 4 + 1, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C2 * 4 + 1, C3 * 4 + 3)] = UniqueID;
// Pairs have no matches in suits; 1 is in second pair
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C2 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, 12);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C2 * 4 + 3, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C2 * 4 + 3, C3 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C2 * 4 + 2, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C2 * 4 + 2, C3 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C2 * 4 + 1, C3 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C2 * 4 + 1, C3 * 4 + 1)] = UniqueID;
}
}
}
}

ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6691
Joined: Jun 22, 2011
August 26th, 2016 at 6:16:05 PM permalink
Part 5 - one pair


// 2-1-1-1
for (C1 = 0; C1 < 13; C1++)
{
for (C2 = 0; C2 < 11; C2++)
{
if (C2 != C1)
{
for (C3 = C2 + 1; C3 < 12; C3++)
{
if (C3 != C1)
{
for (C4 = C3 + 1; C4 < 13; C4++)
{
if (C4 != C1)
{
// All three 1s suited, and the suit is in the 2
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 , 12);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
// All three 1s suited, but the suit is not in the 2
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2, 12);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
// 1s are AAB, both in pair
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 + 1, 12);
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
// 1s are ABA, both in pair
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 , 12);
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
// 1s are BAA, both in pair
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C2 * 4 + 1, C3 * 4 , C4 * 4 , 12);
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 2, C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 3, C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 , C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 , C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 , C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
// 1s are AAB, only A in pair
GetUniqueHand( C1 * 4 , C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 + 1, 24);
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
// 1s are ABA, only A in pair
GetUniqueHand( C1 * 4 , C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 , 24);
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
// 1s are BAA, only A in pair
GetUniqueHand( C1 * 4 , C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 , 24);
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
// 1s are AAB, only B in pair
GetUniqueHand( C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 + 1, 24);
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
// 1s are ABA, only B in pair
GetUniqueHand( C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 , 24);
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
// 1s are BAA, only B in pair
GetUniqueHand( C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 , 24);
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
// 1s are AAB, neither in pair
GetUniqueHand( C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 1, 12);
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
// 1s are ABA, neither in pair
GetUniqueHand( C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 , 12);
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
// 1s are BAA, neither in pair
GetUniqueHand( C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 , 12);
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3)] = UniqueID;
// 1s are all different; only first one in 2
GetUniqueHand( C1 * 4 , C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, 24);
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
// 1s are all different; only second one in 2
GetUniqueHand( C1 * 4 , C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 2, 24);
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
// 1s are all different; only third one in 2
GetUniqueHand( C1 * 4 , C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 , 24);
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
// 1s are all different; first & second in 2
GetUniqueHand( C1 * 4 , C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, 24);
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
// 1s are all different; first & third in 2
GetUniqueHand( C1 * 4 , C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, 24);
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
// 1s are all different; second & third in 2
GetUniqueHand( C1 * 4 + 1, C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, 24);
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1)] = UniqueID;
}
}
}
}
}
}
}

ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6691
Joined: Jun 22, 2011
August 26th, 2016 at 6:17:55 PM permalink
Part 6 - five different cards

This section has over 1100 lines of code, which is too big to post, so it will be broken down by suit breakdown:
Flush
4-1
3-2
3-1-1
2-2-1
2-1-1-1


// 1-1-1-1-1
for (C1 = 0; C1 < 9; C1++)
{
for (C2 = C1 + 1; C2 < 10; C2++)
{
for (C3 = C2 + 1; C3 < 11; C3++)
{
for (C4 = C3 + 1; C4 < 12; C4++)
{
for (C5 = C4 + 1; C5 < 13; C5++)
{
// 1-1-1-1-1 by suits:
// Flush
GetUniqueHand( C1 * 4 , C2 * 4 , C3 * 4 , C4 * 4 , C5 * 4 , 4);
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
// 4-1 AAAAB
GetUniqueHand( C1 * 4 , C2 * 4 , C3 * 4 , C4 * 4 , C5 * 4 + 1, 12);
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 , C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 , C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
// 4-1 AAABA
GetUniqueHand( C1 * 4 , C2 * 4 , C3 * 4 , C4 * 4 + 1, C5 * 4 , 4);
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 , C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 , C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
// 4-1 AABAA
GetUniqueHand( C1 * 4 , C2 * 4 , C3 * 4 + 1, C4 * 4 , C5 * 4 , 12);
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 2, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 3, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 , C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 , C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 , C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
// 4-1 ABAAA
GetUniqueHand( C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 , C5 * 4 , 12);
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
// 4-1 BAAAA
GetUniqueHand( C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 , C5 * 4 , 12);
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;

ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6691
Joined: Jun 22, 2011
August 26th, 2016 at 6:19:19 PM permalink
Part 6b - five different cards, with 3-2 and 3-1-1 suit breakdowns


// 3-2 AAABB
GetUniqueHand( C1 * 4 , C2 * 4 , C3 * 4 , C4 * 4 + 1, C5 * 4 + 1, 12);
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 , C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 , C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
// 3-2 AABAB
GetUniqueHand( C1 * 4 , C2 * 4 , C3 * 4 + 1, C4 * 4 , C5 * 4 + 1, 12);
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 2, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 3, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 , C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 , C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 , C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
// 3-2 AABBA
GetUniqueHand( C1 * 4 , C2 * 4 , C3 * 4 + 1, C4 * 4 + 1, C5 * 4 , 12);
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 2, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 3, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 , C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 , C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 , C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
// 3-2 ABAAB
GetUniqueHand( C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 , C5 * 4 + 1, 12);
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
// 3-2 ABABA
GetUniqueHand( C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 + 1, C5 * 4 , 12);
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
// 3-2 ABBAA
GetUniqueHand( C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 , C5 * 4 , 12);
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
// 3-2 BAAAB
GetUniqueHand( C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 , C5 * 4 + 1, 12);
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
// 3-2 BAABA
GetUniqueHand( C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 + 1, C5 * 4 , 12);
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
// 3-2 BABAA
GetUniqueHand( C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 , C5 * 4 , 12);
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
// 3-2 BBAAA
GetUniqueHand( C1 * 4 + 1, C2 * 4 + 1, C3 * 4 , C4 * 4 , C5 * 4 , 12);
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 , C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 , C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
// 3-1-1 AAABC
GetUniqueHand( C1 * 4 , C2 * 4 , C3 * 4 , C4 * 4 + 1, C5 * 4 + 2, 24);
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 , C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 , C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 , C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 , C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 , C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
// 3-1-1 AABAC
GetUniqueHand( C1 * 4 , C2 * 4 , C3 * 4 + 1, C4 * 4 , C5 * 4 + 2, 24);
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 1, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 2, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 2, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 3, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 3, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 , C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 , C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 , C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 , C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 , C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 , C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
// 3-1-1 AABCA
GetUniqueHand( C1 * 4 , C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, C5 * 4 , 24);
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 1, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 2, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 2, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 3, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 3, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 , C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 , C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 , C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 , C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 , C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 , C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
// 3-1-1 ABAAC
GetUniqueHand( C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 , C5 * 4 + 2, 24);
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
// 3-1-1 ABACA
GetUniqueHand( C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 + 2, C5 * 4 , 24);
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
// 3-1-1 ABCAA
GetUniqueHand( C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 , C5 * 4 , 24);
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
// 3-1-1 BAAAC
GetUniqueHand( C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 , C5 * 4 + 2, 24);
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
// 3-1-1 BAACA
GetUniqueHand( C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 + 2, C5 * 4 , 24);
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
// 3-1-1 BACAA
GetUniqueHand( C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 , C5 * 4 , 24);
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
// 3-1-1 BCAAA
GetUniqueHand( C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 , C5 * 4 , 24);
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;

ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6691
Joined: Jun 22, 2011
August 26th, 2016 at 6:21:58 PM permalink
Part 6c - five different cards, with 2-2-1 suit breakdowns


// 2-2-1 AABBC
GetUniqueHand( C1 * 4 , C2 * 4 , C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 2, 24);
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 , C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 , C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 , C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 , C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 , C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 , C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
// 2-2-1 AABCB
GetUniqueHand( C1 * 4 , C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 1, 24);
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 , C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 , C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 , C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 , C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 , C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 , C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
// 2-2-1 AACBB
GetUniqueHand( C1 * 4 , C2 * 4 , C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 1, 24);
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 , C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 , C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 , C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 , C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 , C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 , C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
// 2-2-1 ABABC
GetUniqueHand( C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 + 1, C5 * 4 + 2, 24);
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
// 2-2-1 ABACB
GetUniqueHand( C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 + 2, C5 * 4 + 1, 24);
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
// 2-2-1 ACABB
GetUniqueHand( C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 + 1, C5 * 4 + 1, 24);
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
// 2-2-1 ABBAC
GetUniqueHand( C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 , C5 * 4 + 2, 24);
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
// 2-2-1 ABCAB
GetUniqueHand( C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 , C5 * 4 + 1, 24);
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
// 2-2-1 ACBAB
GetUniqueHand( C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 , C5 * 4 + 1, 24);
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
// 2-2-1 ABBCA
GetUniqueHand( C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 , 24);
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
// 2-2-1 ABCBA
GetUniqueHand( C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 , 24);
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
// 2-2-1 ACBBA
GetUniqueHand( C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 , 24);
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
// 2-2-1 CAABB (24)
GetUniqueHand( C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 + 1, C5 * 4 + 1, 24);
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
// 2-2-1 CABAB (24)
GetUniqueHand( C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 , C5 * 4 + 1, 24);
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
// 2-2-1 CABBA (24)
GetUniqueHand( C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 1, C5 * 4 , 24);
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;

ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6691
Joined: Jun 22, 2011
August 26th, 2016 at 6:22:51 PM permalink
Part 6d (the final part) - five different cards, with 2-1-1-1 suit breakdowns


// 2-1-1-1 AABCD (24)
GetUniqueHand( C1 * 4 , C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 3, 24);
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 , C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 , C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 , C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 , C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 , C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 , C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 , C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 )] = UniqueID;
// 2-1-1-1 ABACD (24)
GetUniqueHand( C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 + 2, C5 * 4 + 3, 24);
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 , C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 , C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 , C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 )] = UniqueID;
// 2-1-1-1 ABCAD (24)
GetUniqueHand( C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 , C5 * 4 + 3, 24);
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 )] = UniqueID;
// 2-1-1-1 ABCDA (24)
GetUniqueHand( C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 , 24);
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 , C5 * 4 + 3)] = UniqueID;
// 2-1-1-1 BAACD (24)
GetUniqueHand( C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 + 2, C5 * 4 + 3, 24);
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 , C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 , C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 , C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 )] = UniqueID;
// 2-1-1-1 BACAD (24)
GetUniqueHand( C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 , C5 * 4 + 3, 24);
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 )] = UniqueID;
// 2-1-1-1 BACDA (24)
GetUniqueHand( C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 3, C5 * 4 , 24);
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 , C5 * 4 + 3)] = UniqueID;
// 2-1-1-1 BCAAD (24)
GetUniqueHand( C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 , C5 * 4 + 3, 24);
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 3, C5 * 4 )] = UniqueID;
// 2-1-1-1 BCADA (24)
GetUniqueHand( C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 3, C5 * 4 , 24);
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 3, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 2, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 1, C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 , C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 , C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 , C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 , C5 * 4 + 3)] = UniqueID;
// 2-1-1-1 BCDAA (24)
GetUniqueHand( C1 * 4 + 1, C2 * 4 + 2, C3 * 4 + 3, C4 * 4 , C5 * 4 , 24);
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 + 2, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 + 3, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 + 1, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 + 2, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 + 1, C4 * 4 , C5 * 4 )] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 3, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 3, C3 * 4 , C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 2, C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 2, C3 * 4 , C4 * 4 + 1, C5 * 4 + 1)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 3, C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 3, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 3, C3 * 4 , C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 , C3 * 4 + 1, C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 + 3, C2 * 4 + 1, C3 * 4 , C4 * 4 + 2, C5 * 4 + 2)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 1, C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 , C2 * 4 + 2, C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 , C3 * 4 + 2, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 1, C2 * 4 + 2, C3 * 4 , C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 , C3 * 4 + 1, C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
AllHands[GetID(C1 * 4 + 2, C2 * 4 + 1, C3 * 4 , C4 * 4 + 3, C5 * 4 + 3)] = UniqueID;
}
}
}
}
}
}

Wizard
Administrator
Wizard
  • Threads: 1519
  • Posts: 27067
Joined: Oct 14, 2009
August 26th, 2016 at 8:42:39 PM permalink
This is great stuff!

Beers I owe you++;
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
RS
RS
  • Threads: 62
  • Posts: 8626
Joined: Feb 11, 2014
August 26th, 2016 at 9:21:02 PM permalink
Quote: Wizard

This is great stuff!

Beers I owe you++;



Don't you mean Beers++ ?
tringlomane
tringlomane
  • Threads: 8
  • Posts: 6284
Joined: Aug 25, 2012
August 27th, 2016 at 12:19:58 AM permalink
Great stuff!!!
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
August 27th, 2016 at 1:35:04 AM permalink
If you're interested, here are some code cleanup/optimization tips. I will use the code in Main Code Part 3 - One Pair as an example.

The code currently looks like this:
for (C1 = 0; C1 < 13; C1++)
{
for (C2 = 0; C2 < 11; C2++)
{
if (C2 != C1)
{
for (C3 = C2 + 1; C3 < 12; C3++)
{
if (C3 != C1)
{
for (C4 = C3 + 1; C4 < 13; C4++)
{
if (C4 != C1)
{
// long list of statements...
}
}
}
}
}
}
}

That's a lot of indentation. You can eliminate the if blocks by inverting the condition and continuing the loop when the inverted condition is true, like so:

for (C1 = 0; C1 < 13; C1++)
{
for (C2 = 0; C2 < 11; C2++)
{
if (C2 == C1) continue; // if (C2 != C1) then execute the rest of this loop

for (C3 = C2 + 1; C3 < 12; C3++)
{
if (C3 == C1) continue; // if (C3 != C1) then execute the rest of this loop

for (C4 = C3 + 1; C4 < 13; C4++)
{
if (C4 == C1) continue; // if (C4 != C1) then execute the rest of this loop

// long list of statements...
}
}
}
}


Then you can align the loop statements like this (you may have to fight with the Visual Studio editor a bit):
for (C1 =      0; C1 < 13; C1++) {
for (C2 = 0; C2 < 11; C2++) { if (C2 == C1) continue;
for (C3 = C2 + 1; C3 < 12; C3++) { if (C3 == C1) continue;
for (C4 = C3 + 1; C4 < 13; C4++) { if (C4 == C1) continue;

// long list of statements...

} } } }


And you can tighten things up even further by reversing the order of the inner three loops, like so:
for (C1 = 0; C1 < 13; C1++) {
for (C4 = 2; C4 < 13; C4++) { if (C4 == C1) continue;
for (C3 = 1; C3 < C4; C3++) { if (C3 == C1) continue;
for (C2 = 0; C2 < C3; C2++) { if (C2 == C1) continue;

// long list of statements...

} } } }

You may find this more manageable than having multiple indented layers of for loops and if blocks.
Wizard
Administrator
Wizard
  • Threads: 1519
  • Posts: 27067
Joined: Oct 14, 2009
August 27th, 2016 at 2:00:46 AM permalink
Quote: RS

Don't you mean Beers++ ?



A question mark doesn't end a statement in C.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
RS
RS
  • Threads: 62
  • Posts: 8626
Joined: Feb 11, 2014
August 27th, 2016 at 3:24:26 AM permalink
Quote: Wizard

A question mark doesn't end a statement in C.



It was a question, though;

Happy now? :)
BTLWI
BTLWI
  • Threads: 6
  • Posts: 461
Joined: Nov 6, 2013
August 27th, 2016 at 7:51:28 AM permalink
I owe you beers++; would have been better pseudo code.
miplet
miplet
  • Threads: 5
  • Posts: 2143
Joined: Dec 1, 2009
August 27th, 2016 at 8:40:47 AM permalink
Quote: BTLWI

I owe you beers++; would have been better pseudo code.


UPPIN YR BEER
“Man Babes” #AxelFabulous
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
August 27th, 2016 at 9:02:19 AM permalink
Quote: ThatDonGuy

The answer, as far as I know, is, "No, there's no 'easy' way; it has to be done by brute force." In fact, I find that it is easiest to build the table of unique hands while you are doing the mapping of the 2,598,960 hands.

Here is some slightly modified C# code that generates both the "unique hands" and maps all of the 5-card hands to them.

There's a much more elegant way -- it comes from looking at the big picture of the problem that you're trying to solve rather than the individual pieces. Forest for the trees, as it were.

The problem to be solved is "how do I reduce a set of 5 card combinations to a smaller set if the only difference is the suits are rotated?" I call this suit-folding, others have called it other things. If you start with "for Full Houses, there are 4 ways to have the trips ..." then that's the piecemeal approach. The big picture approach is "I don't care about which specific suits are which, I just care about the "shape" of each hand, and I want all hands that have the same "shape" to be in the same bucket. For that, you can simply separate a hand into its component suits, anonymize those suits by sorting them, rebuild a hand with the anonymized suits, and see if it's a new shape or a familiar one. As long as your sort order is consistent, it doesn't even matter what it is. So:
a) For each hand object in all 52c5 hands, get the four suit-specific data items.
b) Put those four items in a list
c) Sort them
d) Build a new hand from the newly-sorted items.
e) If the new hand isn't yet in your list of suit-folded hands, add it.
f) Optionally, store other data about the suit-folded hands, like how many times each one showed up. Then when you iterate over all 134459 items and sum up the count, it should be 52c5 (that's a good check to make sure your code works).

Now, depending on your underlying data structures, you may need to build a few foundational pieces first, like the ability to get a data item for the particular suits in each hand, the ability to sort those data items, or the ability to compare hands for equality. The code I use is based on bitmasks so everything's an integer and sorting/comparing are built-in. That code is Keith Rule's C# port of the old poker-eval code, which is here:
http://www.codeproject.com/Articles/12279/Fast-Texas-Holdem-Hand-Evaluation-and-Analysis
It already has basically all of the above in place, except for the suit-folding stuff, but since it's already using bitmasks and you can get at the mask for each suit, actually doing the suit folding using the C# collections classes is trivial. The code I use to do this is less than 25 lines.
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6691
Joined: Jun 22, 2011
August 27th, 2016 at 4:04:40 PM permalink
Quote: MathExtremist

There's a much more elegant way -- it comes from looking at the big picture of the problem that you're trying to solve rather than the individual pieces. Forest for the trees, as it were.
a) For each hand object in all 52c5 hands, get the four suit-specific data items.
b) Put those four items in a list
c) Sort them
d) Build a new hand from the newly-sorted items.
e) If the new hand isn't yet in your list of suit-folded hands, add it.
f) Optionally, store other data about the suit-folded hands, like how many times each one showed up. Then when you iterate over all 134459 items and sum up the count, it should be 52c5 (that's a good check to make sure your code works).



int[] PowerOf2 = new int[] { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096 };

int[,] Combin = new int[53, 6];

long c65536Squared = 65536L * 65536L;
long c65536Cubed = c65536Squared * 65536L;

List<long> UniqueHandsList = new List<long>(134460);
List<int> HandCount = new List<int>(134459);

int[] B = new int[4];
int C1, C2, C3, C4, C5;
int HandID;
long BKey;
int N, N2, N3;
for (N = 5; N <= 52; N++)
{
Combin[N, 1] = N;
for (N2 = 2; N2 <= 5; N2++)
{
Combin[N, N2] = Combin[N, N2 - 1] * (N + 1 - N2) / N2;
}
}

for (C1 = 0; C1 < 48; C1++)
{
for (C2 = C1 + 1; C2 < 49; C2++)
{
for (C3 = C2 + 1; C3 < 50; C3++)
{
for (C4 = C3 + 1; C4 < 51; C4++)
{
for (C5 = C4 + 1; C5 < 52; C5++)
{
HandID = Combin[52, 5] - Combin[52 - C1, 5]
+ Combin[51 - C1, 4] - Combin[52 - C2, 4]
+ Combin[51 - C2, 3] - Combin[52 - C3, 3]
+ Combin[51 - C3, 2] - Combin[52 - C4, 2]
+ (51 - C4) - (52 - C5);
for (N = 0; N < 4; N++)
{
B[N] = 0;
}
B[C1 % 4] += PowerOf2[C1 / 4];
B[C2 % 4] += PowerOf2[C2 / 4];
B[C3 % 4] += PowerOf2[C3 / 4];
B[C4 % 4] += PowerOf2[C4 / 4];
B[C5 % 4] += PowerOf2[C5 / 4];
// Sort the B-values
for (N = 0; N < 3; N++)
{
for (N2 = N + 1; N2 < 4; N2++)
{
if (B[N2] < B[N])
{
N3 = B[N2];
B[N2] = B[N];
B[N] = N3;
}
}
}
// Since no B-value > 2^13, convert the sorted B-values to a long
BKey = B[0] * c65536Cubed + B[1] * c65536Squared + B[2] * 65536L + B[3];
// See if BKey is in UniqueHands
N = UniqueHandsList.IndexOf(BKey);
if (N < 0)
{
UniqueHandsList.Add(BKey);
HandCount.Add(0);
N = UniqueHandsList.Count - 1;
}
HandCount[N]++;
}
}
}
}
}


Even this is brute force - I don't see an easy way to look at a 5-card hand and determine a "unique hand" value from it.
Wizard
Administrator
Wizard
  • Threads: 1519
  • Posts: 27067
Joined: Oct 14, 2009
August 27th, 2016 at 4:50:24 PM permalink
Can anybody suggest a way, preferably in English, to test if two hands are of equivalent value? Not just for five-card hands but a general way for any number of cards.

For example, QhQdQsKhKc would be equivalent to QcQsQdKcKh, because one of the suits of the kings matches a queen suit and the other doesn't.

QhQdQsKhKc would not be equivalent to QcQsQdKcKs, because in the second hand both kings suits used by the queens.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6691
Joined: Jun 22, 2011
August 27th, 2016 at 5:51:23 PM permalink
Quote: Wizard

Can anybody suggest a way, preferably in English, to test if two hands are of equivalent value? Not just for five-card hands but a general way for any number of cards.

For example, QhQdQsKhKc would be equivalent to QcQsQdKcKh, because one of the suits of the kings matches a queen suit and the other doesn't.

QhQdQsKhKc would not be equivalent to QcQsQdKcKs, because in the second hand both kings suits used by the queens.


If I am reading this correctly, the "easiest" way is probably the way MathExtremist described, or at least the way I subsequently implemented it:

First, for each suit, count 1 for an Ace, 2 for a 2, 4 for a 3, 8 for a 4, and so on through 4096 for a King, and add up the values. For example, an Ace, 6, Queen of spades is 1 + 32 + 1024 = 1057.
Then, sort the numbers. If the two hands' sorted numbers match in order, then they are equivalent.
Note that this only works as written if each card is unique within the deck. It also doesn't work "as written" for, say, Deuces Wild (AsAhAcKd2s would not be treated the same as AsAhAcKd2d), although in that case, you don't count wild cards as any suit but instead count the number of wild cards to see if they are equal.
Wizard
Administrator
Wizard
  • Threads: 1519
  • Posts: 27067
Joined: Oct 14, 2009
August 27th, 2016 at 5:57:14 PM permalink
Quote: ThatDonGuy

First, for each suit, count 1 for an Ace, 2 for a 2, 4 for a 3, 8 for a 4, and so on through 4096 for a King, and add up the values. For example, an Ace, 6, Queen of spades is 1 + 32 + 1024 = 1057.
Then, sort the numbers. If the two hands' sorted numbers match in order, then they are equivalent.
Note that this only works as written if each card is unique within the deck. It also doesn't work "as written" for, say, Deuces Wild (AsAhAcKd2s would not be treated the same as AsAhAcKd2d), although in that case, you don't count wild cards as any suit but instead count the number of wild cards to see if they are equal.



Thank you! I guess I skimmed the thread too quickly. This should come in handy the next time I have to analyze a seven-card game.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
August 27th, 2016 at 6:21:38 PM permalink
Quote: Wizard

Thank you! I guess I skimmed the thread too quickly. This should come in handy the next time I have to analyze a seven-card game.


You might find the method I describe in this post useful, though probably not for programming.
Last edited by: JB on Aug 27, 2016
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
August 27th, 2016 at 8:46:08 PM permalink
Quote: ThatDonGuy

If I am reading this correctly, the "easiest" way is probably the way MathExtremist described, or at least the way I subsequently implemented it:

First, for each suit, count 1 for an Ace, 2 for a 2, 4 for a 3, 8 for a 4, and so on through 4096 for a King, and add up the values. For example, an Ace, 6, Queen of spades is 1 + 32 + 1024 = 1057.
Then, sort the numbers. If the two hands' sorted numbers match in order, then they are equivalent.
Note that this only works as written if each card is unique within the deck. It also doesn't work "as written" for, say, Deuces Wild (AsAhAcKd2s would not be treated the same as AsAhAcKd2d), although in that case, you don't count wild cards as any suit but instead count the number of wild cards to see if they are equal.

Your coding life will be way, way better if you replace all the integer manipulations with bitmasks, bitwise operators, and bit shifting. I'd get the Keith Rule code and check it out. If you can work with that successfully, you'll subsequently save a lot of time typing out and storing powers of 2. From your prior post, instead of saving variables and typing out big numbers:
BKey = B[0] * c65536Cubed + B[1] * c65536Squared + B[2] * 65536L + B[3];
do this instead:
BKey = B[0] << 16*3 | B[1] << 16*2 | B[2] << 16 | B[3];

That gives you a lot of quick and cheap ways of checking for flushes or straights. For example, if you have five cards and three out of the four suit bitmasks are zero, all the cards are in the other suit so that's a flush. On the other hand, if you're looking for a fast 5-card (or 7-card) poker hand evaluator, the poker-eval method isn't the fastest, not by a long shot. You should absolutely not be trying to write your own, though, this is a problem that's been worked on for a very long time. Read through this before doing anything else:
http://web.archive.org/web/20130116102452/http://www.codingthewheel.com/archives/poker-hand-evaluator-roundup
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
Wizard
Administrator
Wizard
  • Threads: 1519
  • Posts: 27067
Joined: Oct 14, 2009
August 28th, 2016 at 7:22:45 AM permalink
Quote: JB

You might find the method I describe in this post useful, though probably not for programming.



Thanks, that was good.

Another issue is how to store the possible outcomes for any given hand under your sorting method. One could use a very large four-dimensional array, but I fear memory limitations. I imagine a good programmer might use linked lists. Any suggestions for us less advanced programmers that doesn't hog up too much memory?
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
August 28th, 2016 at 11:39:14 AM permalink
Quote: Wizard

Quote: JB

You might find the method I describe in this post useful, though probably not for programming.



Thanks, that was good.

Another issue is how to store the possible outcomes for any given hand under your sorting method. One could use a very large four-dimensional array, but I fear memory limitations. I imagine a good programmer might use linked lists. Any suggestions for us less advanced programmers that doesn't hog up too much memory?

Not sure exactly what data you're looking to store, but why not use collections classes regardless? No need to reimplement things. If you're in C++, use the STL:
http://www.cplusplus.com/reference/stl/
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
August 28th, 2016 at 9:12:32 PM permalink
Quote: Wizard

Quote: JB

You might find the method I describe in this post useful, though probably not for programming.



Thanks, that was good.

Another issue is how to store the possible outcomes for any given hand under your sorting method. One could use a very large four-dimensional array, but I fear memory limitations. I imagine a good programmer might use linked lists. Any suggestions for us less advanced programmers that doesn't hog up too much memory?


This is something that I still would like to crack, in the following sense:

1) Loop through all combin(deck_size, hand_size) combinations
2) Convert the cards into a unique "handprint"
3) Add the unique handprint to a growing collection if it doesn't already exist (with an initial weight of 1), or increment its weight by 1 if it does already exist (in C#, the Dictionary<> class is good for this)

I may take another stab at it within the next week or so. I ran into the same problem when I made the Pai Gow Poker calculator. The PGP data file only contains results for the unique handprints. But since the calculator can accept any 7-card hand, I needed a way to identify which unique handprint a raw 7-card hand corresponds to. In the end, I made a separate binary file which maps each 7-card combination to the unique handprint that represents it.
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
August 28th, 2016 at 9:54:18 PM permalink
Quote: JB

Quote: Wizard

Quote: JB

You might find the method I describe in this post useful, though probably not for programming.



Thanks, that was good.

Another issue is how to store the possible outcomes for any given hand under your sorting method. One could use a very large four-dimensional array, but I fear memory limitations. I imagine a good programmer might use linked lists. Any suggestions for us less advanced programmers that doesn't hog up too much memory?


This is something that I still would like to crack, in the following sense:

1) Loop through all combin(deck_size, hand_size) combinations
2) Convert the cards into a unique "handprint"
3) Add the unique handprint to a growing collection if it doesn't already exist (with an initial weight of 1), or increment its weight by 1 if it does already exist (in C#, the Dictionary<> class is good for this)

That's exactly what my code does, and it uses the Dictionary object to do it. The only difference is the looping step is an iterator. I don't use a nested for-loop, I have an enumeration that I can do a foreach over. The iterator routines are already provided by the Keith Rule code, I didn't have to do a thing other than call them.

Quote:

I may take another stab at it within the next week or so. I ran into the same problem when I made the Pai Gow Poker calculator. The PGP data file only contains results for the unique handprints. But since the calculator can accept any 7-card hand, I needed a way to identify which unique handprint a raw 7-card hand corresponds to. In the end, I made a separate binary file which maps each 7-card combination to the unique handprint that represents it.

You can use exactly the same method during runtime for single hand analysis as you do during the suit-folding: split out the suits, sort them, then reform into the handprint for that hand.
Or just store it in a lookup table from all hands to handprints, but I think using the method is easier and takes less space if that's a concern. Runtime efficiency on a single hand isn't the bottleneck when you're dealing with user interaction.
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
August 28th, 2016 at 10:02:58 PM permalink
Quote: MathExtremist

split out the suits, sort them, then reform into the handprint for that hand.


Indeed, this works. Here is some C# code which loops through the 2,598,960 hands and compiles a list of the 134,459 unique handprints:

var list = new Dictionary<long, int>();

for (var c5 = 4; c5 < 52; ++c5) { var s5 = c5 / 13; var r5 = c5 % 13; var b5 = 1 << r5;
for (var c4 = 3; c4 < c5; ++c4) { var s4 = c4 / 13; var r4 = c4 % 13; var b4 = 1 << r4;
for (var c3 = 2; c3 < c4; ++c3) { var s3 = c3 / 13; var r3 = c3 % 13; var b3 = 1 << r3;
for (var c2 = 1; c2 < c3; ++c2) { var s2 = c2 / 13; var r2 = c2 % 13; var b2 = 1 << r2;
for (var c1 = 0; c1 < c2; ++c1) { var s1 = c1 / 13; var r1 = c1 % 13; var b1 = 1 << r1;

var suit1 = 0;
var suit2 = 0;
var suit3 = 0;
var suit4 = 0;

if (s5 == 0) { suit1 |= b5; } else if (s5 == 1) { suit2 |= b5; } else if (s5 == 2) { suit3 |= b5; } else { suit4 |= b5; }
if (s4 == 0) { suit1 |= b4; } else if (s4 == 1) { suit2 |= b4; } else if (s4 == 2) { suit3 |= b4; } else { suit4 |= b4; }
if (s3 == 0) { suit1 |= b3; } else if (s3 == 1) { suit2 |= b3; } else if (s3 == 2) { suit3 |= b3; } else { suit4 |= b3; }
if (s2 == 0) { suit1 |= b2; } else if (s2 == 1) { suit2 |= b2; } else if (s2 == 2) { suit3 |= b2; } else { suit4 |= b2; }
if (s1 == 0) { suit1 |= b1; } else if (s1 == 1) { suit2 |= b1; } else if (s1 == 2) { suit3 |= b1; } else { suit4 |= b1; }

if (suit1 > suit2) { var t = suit1; suit1 = suit2; suit2 = t; }
if (suit1 > suit3) { var t = suit1; suit1 = suit3; suit3 = t; }
if (suit1 > suit4) { var t = suit1; suit1 = suit4; suit4 = t; }
if (suit2 > suit3) { var t = suit2; suit2 = suit3; suit3 = t; }
if (suit2 > suit4) { var t = suit2; suit2 = suit4; suit4 = t; }
if (suit3 > suit4) { var t = suit3; suit3 = suit4; suit4 = t; }

var key = ((long)suit1 << 39) + ((long)suit2 << 26) + ((long)suit3 << 13) + suit4;

if (list.ContainsKey(key))
{
++list[key];
}
else
{
list.Add(key, 1);
}

} } } } }

Console.WriteLine("Count = {0}", list.Count);

// output:
// Count = 134459
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
August 29th, 2016 at 7:48:31 AM permalink
Quote: JB

Indeed, this works. Here is some C# code which loops through the 2,598,960 hands and compiles a list of the 134,459 unique handprints:

var list = new Dictionary<long, int>();

for (var c5 = 4; c5 < 52; ++c5) { var s5 = c5 / 13; var r5 = c5 % 13; var b5 = 1 << r5;
for (var c4 = 3; c4 < c5; ++c4) { var s4 = c4 / 13; var r4 = c4 % 13; var b4 = 1 << r4;
for (var c3 = 2; c3 < c4; ++c3) { var s3 = c3 / 13; var r3 = c3 % 13; var b3 = 1 << r3;
for (var c2 = 1; c2 < c3; ++c2) { var s2 = c2 / 13; var r2 = c2 % 13; var b2 = 1 << r2;
for (var c1 = 0; c1 < c2; ++c1) { var s1 = c1 / 13; var r1 = c1 % 13; var b1 = 1 << r1;

var suit1 = 0;
var suit2 = 0;
var suit3 = 0;
var suit4 = 0;

if (s5 == 0) { suit1 |= b5; } else if (s5 == 1) { suit2 |= b5; } else if (s5 == 2) { suit3 |= b5; } else { suit4 |= b5; }
if (s4 == 0) { suit1 |= b4; } else if (s4 == 1) { suit2 |= b4; } else if (s4 == 2) { suit3 |= b4; } else { suit4 |= b4; }
if (s3 == 0) { suit1 |= b3; } else if (s3 == 1) { suit2 |= b3; } else if (s3 == 2) { suit3 |= b3; } else { suit4 |= b3; }
if (s2 == 0) { suit1 |= b2; } else if (s2 == 1) { suit2 |= b2; } else if (s2 == 2) { suit3 |= b2; } else { suit4 |= b2; }
if (s1 == 0) { suit1 |= b1; } else if (s1 == 1) { suit2 |= b1; } else if (s1 == 2) { suit3 |= b1; } else { suit4 |= b1; }

if (suit1 > suit2) { var t = suit1; suit1 = suit2; suit2 = t; }
if (suit1 > suit3) { var t = suit1; suit1 = suit3; suit3 = t; }
if (suit1 > suit4) { var t = suit1; suit1 = suit4; suit4 = t; }
if (suit2 > suit3) { var t = suit2; suit2 = suit3; suit3 = t; }
if (suit2 > suit4) { var t = suit2; suit2 = suit4; suit4 = t; }
if (suit3 > suit4) { var t = suit3; suit3 = suit4; suit4 = t; }

var key = ((long)suit1 << 39) + ((long)suit2 << 26) + ((long)suit3 << 13) + suit4;

if (list.ContainsKey(key))
{
++list[key];
}
else
{
list.Add(key, 1);
}

} } } } }

Console.WriteLine("Count = {0}", list.Count);

// output:
// Count = 134459


You can replace a significant chunk of that code if you do things using one big mask instead of trying to figure out what the suits are individually. You don't care *what* the suits are, just which ones are distinct from the others.

var list = new Dictionary<long, int>();
List<uint> suits = new List<uint>();

for (var c5 = 4; c5 < 52; ++c5) {
for (var c4 = 3; c4 < c5; ++c4) {
for (var c3 = 2; c3 < c4; ++c3) {
for (var c2 = 1; c2 < c3; ++c2) {
for (var c1 = 0; c1 < c2; ++c1) {

// Set a bit for each card in the bitmask
ulong mask = 1 << c5 | 1 << c4 | 1 << c3 | 1 << c2 | 1 << c1;

// reused variable - start with a blank slate
suits.clear();

// strip the suits out, add them individually to the container
suits.Add((uint)((mask >> (13 * 0)) & 0x1fffUL));
suits.Add((uint)((mask >> (13 * 1)) & 0x1fffUL));
suits.Add((uint)((mask >> (13 * 2)) & 0x1fffUL));
suits.Add((uint)((mask >> (13 * 3)) & 0x1fffUL));

// sort them
suits.Sort();

// rebuild the handprint
ulong key = (ulong)suits[0] | (ulong)suits[1] << (13 * 1) | (ulong)suits[2] << (13 * 2) | (ulong)suits[3] << (13 * 3);

// use the key however you want (e.g., the add-or-increment operation you're already doing.)
// ...
} } } } }

Also, for what it's worth, I never use "var" unless I have to. If I'm declaring a variable and know what type it is, I want the code to reflect that for ease of reading later on.
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
August 29th, 2016 at 2:08:52 PM permalink
Quote: MathExtremist

You can replace a significant chunk of that code if you do things using one big mask instead of trying to figure out what the suits are individually. You don't care *what* the suits are, just which ones are distinct from the others.


Very clever!

Quote: MathExtremist

Also, for what it's worth, I never use "var" unless I have to. If I'm declaring a variable and know what type it is, I want the code to reflect that for ease of reading later on.


Technically you never really have to, but I only recently started using it. I'm a neat freak with the code, in the sense that I like the types and variable names aligned, like this:
int     IntVar      = 0;
long LongVar = 0L;
double DoubleVar = 0.0;
string StringVar = "";

Which is all fine and dandy until you add a Dictionary:
int                         IntVar      = 0;
long LongVar = 0L;
double DoubleVar = 0.0;
string StringVar = "";
Dictionary<string, int> LookupTable = new Dictionary<string, int>();

Now it's clunky and awkward. But with var, they can all be neatly (tightly) aligned -- and as an added bonus, you don't have to repeat yourself with the Dictionary variable:
var IntVar      = 0;
var LongVar = 0L;
var DoubleVar = 0.0;
var StringVar = "";
var LookupTable = new Dictionary<string, int>();

The variables are still strongly-typed, you just have to look to the right of the equals sign instead of the left to see what type.

I also find var better because it forces me to be precise with the initialized value. For example:
var DoubleVar = 0;
makes DoubleVar an int, whereas if I use the proper initialization value like this:
var DoubleVar = 0.0;
then DoubleVar is a double as intended.

Since var can only be used for local variables anyway, it is useful syntactic sugar.
socks
socks
  • Threads: 15
  • Posts: 364
Joined: Jul 13, 2011
September 16th, 2016 at 10:14:43 PM permalink
Quote: ThatDonGuy

I seem to recall somebody asking a while ago if there was an "easy" way to map the 2,598,960 different possible 5-card hands into the 134,459 "unique" 5-card hands...



It might have been me, though I think others have asked too. I finally figured it out this past spring, in a general (but still brute force) way. I have 5 card and 6 card tables saved, as well as a 5-1 version for when the dealer has a card up. I haven't tested it, so I'm not certain it works, but when I get my C.Stud code running, I should know.

I thought I had 7 cards, but I don't see it now. Maybe there were memory problems when trying to generate it. I'm sure it shouldn't take much to get it to work.

Thanks though,
John
socks
socks
  • Threads: 15
  • Posts: 364
Joined: Jul 13, 2011
September 18th, 2016 at 12:22:19 PM permalink
To followup, I'm getting 962988 representative hands for 6 cards. Unless I'm missing something, you can also map suits across dealer upcards, but my initial try is only saving about 11% (5648874 hands) for a 5 card hand with 1 dealer up card. I haven't tested outcomes against any actual, known, results, so I'm not sure that's correct.

I was using high level representations to do this, and throwing them in text files, and this must've failed at some point for 7 cards. I'm going to try to pack hands into bytes and try again. I got distracted by something last spring and never took this step.
Wizard
Administrator
Wizard
  • Threads: 1519
  • Posts: 27067
Joined: Oct 14, 2009
September 30th, 2016 at 6:21:02 AM permalink
Quote: MathExtremist


var list = new Dictionary<long, int>();
List<uint> suits = new List<uint>();

for (var c5 = 4; c5 < 52; ++c5) {
for (var c4 = 3; c4 < c5; ++c4) {
for (var c3 = 2; c3 < c4; ++c3) {
for (var c2 = 1; c2 < c3; ++c2) {
for (var c1 = 0; c1 < c2; ++c1) {

// Set a bit for each card in the bitmask
ulong mask = 1 << c5 | 1 << c4 | 1 << c3 | 1 << c2 | 1 << c1;

// reused variable - start with a blank slate
suits.clear();

// strip the suits out, add them individually to the container
suits.Add((uint)((mask >> (13 * 0)) & 0x1fffUL));
suits.Add((uint)((mask >> (13 * 1)) & 0x1fffUL));
suits.Add((uint)((mask >> (13 * 2)) & 0x1fffUL));
suits.Add((uint)((mask >> (13 * 3)) & 0x1fffUL));

// sort them
suits.Sort();

// rebuild the handprint
ulong key = (ulong)suits[0] | (ulong)suits[1] << (13 * 1) | (ulong)suits[2] << (13 * 2) | (ulong)suits[3] << (13 * 3);

// use the key however you want (e.g., the add-or-increment operation you're already doing.)
// ...
} } } } }



Thank you. I've been trying to figure out the logic of this but your level is obviously higher than mine.

Can you please go over more slowly, and in as simple English as possible, what these lines do:


ulong mask = 1 << c5 | 1 << c4 | 1 << c3 | 1 << c2 | 1 << c1;

and

suits.Add((uint)((mask >> (13 * 3)) & 0x1fffUL));

and

suits.Add((uint)((mask >> (13 * 0)) & 0x1fffUL));

If the code is different in C++, could I trouble you to translate it.

Thank you!!!
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6691
Joined: Jun 22, 2011
September 30th, 2016 at 9:44:52 AM permalink
Quote: Wizard

Thank you. I've been trying to figure out the logic of this but your level is obviously higher than mine.

Can you please go over more slowly, and in as simple English as possible, what these lines do:


ulong mask = 1 << c5 | 1 << c4 | 1 << c3 | 1 << c2 | 1 << c1;

and

suits.Add((uint)((mask >> (13 * 3)) & 0x1fffUL));

and

suits.Add((uint)((mask >> (13 * 0)) & 0x1fffUL));


Let me see if I can help with an example:


Let c1 = 10, c2 = 20, c3 = 30, c4 = 40, and c5 = 50

1 << c1 is 1 shifted 10 bits to the left, or the binary integer 1 00000 00000
1 << c2 is 1 shifted 20 bits to the left, or the binary integer 1 00000 00000 00000 00000
The same goes for c3, c4, and c5
Since each one is a different binary integer, | effectively adds them, since no bit position will be 1 in more than one of them.
The value for mask is
1 00000 00001 00000 00001 00000 00001 00000 00001 00000 00000
Breaking this into 13-bit blocks, and adding a leading zero since there are only 51 bits listed:
0100000000010 0000000010000 0000010000000 0010000000000
If you treat each block as KQJT98765432A, this is Q-2 of one suit, 5 of a second suit, 8 of a third suit, and J of a fourth suit

mask >> (13 * 0)) is mask >> 0, or a zero-bit shift to the right
That value is then ANDed (&) with 0x1fffUL, which is an unsigned long (UL) integer hexadecimal constant 1FFF, or 1111111111111 in binary
This will replace all of the bits in the value other than the rightmost 13 bits to 0, since anything AND 0 = 0.
In the example, this is 0100000000010 0000000010000 0000010000000 0010000000000 & 1111111111111,
or 0000000000000 0000000000000 0000000000000 0010000000000

mask >> (13 * 1)) is a 13-bit shift to the right, so the second value added to suits is
0100000000010 0000000010000 0000010000000 & 1111111111111,
or 0000000000000 0000000000000 0000010000000

The other two lines shift mask 26 and 39 bits to the right, respectively, so the resulting values are
0000000000000 0000000010000
and 0100000000010

In other words, the four values in Suits are the four 13-bit values representing each suit.

Now for the "House light bulb" moment: sort the numbers. Why bother?
Because if the original hand was 5 of the first suit, 8 of the second, J of the third, and Q2 of the fourth, which is the same hand but with different suits, then mask is
0000000010000 0000010000000 0010000000000 0100000000010
but when they are sorted, they become the same numbers in the same order as the original hand's numbers after they are sorted.

The variable "key" is set to the first sorted number shifted 39 bits to the left | the second sorted number shifted 26 | the third sorted number shifted 13 | the fourth sorted number. Since no more than one bit position will have a 1 in more than 1 of the 4 shifted numbers, OR effectively adds them together.
The key value for all 24 hands that are Q-2 of one suit, 5 of a second, 8 of a third, and 4 of a fourth, is
0000 0000 1000 0000 0010 0000 0000 1000 0000 0000 1000 0000 0010


It has been a while since I have used C++, but I don't think uint and ulong are valid names - they exist, but uint is "unsigned int" and ulong is "unsigned long". I am also not sure if you can specify U in an integer literal.

I think Lists are defined in the standard library; you might have to use std::list, and push_back() instead of add().
socks
socks
  • Threads: 15
  • Posts: 364
Joined: Jul 13, 2011
September 30th, 2016 at 11:12:10 AM permalink
Can anyone confirm that there are 6009159 unique 7 card hands?

Thanks.
Wizard
Administrator
Wizard
  • Threads: 1519
  • Posts: 27067
Joined: Oct 14, 2009
September 30th, 2016 at 1:49:08 PM permalink
Quote: ThatDonGuy

Let me see if I can help with an example...



Thank you! This will take me a while to digest but I wanted to say I appreciate the help.

(beers I owe you)++;
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6691
Joined: Jun 22, 2011
September 30th, 2016 at 4:51:00 PM permalink
Quote: socks

Can anyone confirm that there are 6009159 unique 7 card hands?



I am working on it, but doing a computer search is taking quite a bit of time, considering that the more unique hands there are, the more hands that have to be checked against each remaining hand to see if it is a duplicate. I have a feeling doing it by hand might be faster.

Question: by "seven-card hand," do you mean counting all seven cards, or the best five-card hand of the seven? (For example, are AAAAKKK and AAAAKQJ, where the King, Queen, and Jack are different suits, considered two different hands, or are they both AAAAK?)
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
September 30th, 2016 at 5:27:35 PM permalink
Quote: Wizard

Thank you! This will take me a while to digest but I wanted to say I appreciate the help.

(beers I owe you)++;

I finally got back to my desk and it looks like ThatDonGuy has covered the topic. Here's a decent tutorial:
http://www.cprogramming.com/tutorial/bitwise_operators.html
and here is a compendium of clever bit twiddling hacks:
https://graphics.stanford.edu/~seander/bithacks.html

For the actual data format used in the poker-eval code, and a discussion of a lot of other poker analyzers, see this archive copy of
The Great Poker Hand Evaluator Roundup
Also, don't ever write your own poker hand evaluator. Use one of the above.
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
socks
socks
  • Threads: 15
  • Posts: 364
Joined: Jul 13, 2011
September 30th, 2016 at 5:31:09 PM permalink
Doing it by hand. lol. Is that even possible?

My code for 5 card hands takes about 2 minutes to run, while the 7 card code took 6 hours to run. I'm running on the JVM, and not even using a c-like language. If you want, we can dig into our respective methods to see where they diverge.

When I say 7 card hand, I mean all 7 cards. Otherwise, we have to bake in value judgements. I was thinking I'd rather be able to look for, say low hands, if that's what I want, or define a House Way on the fly. It may be that most use cases are simply covered the other way, and I haven't really thought it through.
socks
socks
  • Threads: 15
  • Posts: 364
Joined: Jul 13, 2011
September 30th, 2016 at 5:36:56 PM permalink
Quote: MathExtremist

For the actual data format used in the poker-eval code, and a discussion of a lot of other poker analyzers, see this archive copy of
The Great Poker Hand Evaluator Roundup
Also, don't ever write your own poker hand evaluator. Use one of the above.


You can also pull the code from:
https://github.com/christophschmalhofer/poker/tree/master/XPokerEval
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
September 30th, 2016 at 5:37:15 PM permalink
Quote: socks

Can anyone confirm that there are 6009159 unique 7 card hands?

Thanks.

Yup, that's it. If you're already using poker-eval, it's a one-character change to go from 5 to 7 cards and about 2 minutes (on my machine) to run through all of them and reduce them to unique handprints. Maybe it's less, I got impatient and stopped it along the way to make sure it wasn't hung...
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
socks
socks
  • Threads: 15
  • Posts: 364
Joined: Jul 13, 2011
September 30th, 2016 at 5:43:44 PM permalink
Quote: MathExtremist

Yup, that's it. If you're already using poker-eval, it's a one-character change to go from 5 to 7 cards and about 2 minutes (on my machine) to run through all of them and reduce them to unique handprints. Maybe it's less, I got impatient and stopped it along the way to make sure it wasn't hung...



Excellent. Thank you :)

I do some of my experimentation in Clojure, a higher level language, so it took a while, but I use a good hand eval for my inner loop, when it matters.
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
September 30th, 2016 at 5:56:27 PM permalink
My professional coding days are basically over and I haven't learned a new language in years. I always wanted to learn R but just haven't gotten around to it. Too much paid work to do, none of it involving coding. Every few years I get to do a source code evaluation, but it's almost invariably in C++.

I just looked up Clojure. It's based on Lisp? All I remember about Lisp was learning emacs and getting headaches counting parentheses.
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
socks
socks
  • Threads: 15
  • Posts: 364
Joined: Jul 13, 2011
September 30th, 2016 at 5:59:58 PM permalink
In addition to evaluators found in XPokerEval, SpecialK's evaluator is fairly novel and interesting. The original blog is gone, but you can find it here:

https://web.archive.org/web/20120719090620/http://specialk-coding.blogspot.fr/2010/04/texas-holdem-7-card-evaluator_23.html
socks
socks
  • Threads: 15
  • Posts: 364
Joined: Jul 13, 2011
September 30th, 2016 at 6:10:10 PM permalink
Quote: MathExtremist

I just looked up Clojure. It's based on Lisp? All I remember about Lisp was learning emacs and getting headaches counting parentheses.



Yes. It "is a LISP" as they say. It was built with performance in mind (compared to other high level languages). It has good collections packed in, and it has really easy memoization. Collections are immutable, making parallel execution easy. There's a REPL. So there are a lot of things making it attractive for playing around with ideas.
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6691
Joined: Jun 22, 2011
October 4th, 2016 at 7:34:36 AM permalink
Quote: ThatDonGuy

I am working on it, but doing a computer search is taking quite a bit of time


...mainly because Microsoft's implementation of lists doesn't seem to be very efficient when doing searches (for duplicate hands). On the other hand, if, at particular intervals (actually, if you have enough memory, you only have to do this once all of the hands are generated), you sort the list, then go through the list one at at time and replace each duplicate hand with 0, then sort again and delete the block of 0s at the front of the list, it runs much faster, and I also get 6009159 hands.
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
October 4th, 2016 at 9:08:11 AM permalink
Quote: ThatDonGuy

...mainly because Microsoft's implementation of lists doesn't seem to be very efficient when doing searches (for duplicate hands). On the other hand, if, at particular intervals (actually, if you have enough memory, you only have to do this once all of the hands are generated), you sort the list, then go through the list one at at time and replace each duplicate hand with 0, then sort again and delete the block of 0s at the front of the list, it runs much faster, and I also get 6009159 hands.

It should be much faster to process the list and turn it into a new map: for each item in the initial list of all hands, do an add-or-increment to a new map or dictionary from canonical hand to integer. That way you end up with the new map containing unique entries for each hand and a count of how many times each occurred. The list size is 6009159 and the sum of the counts is 133784560.
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
socks
socks
  • Threads: 15
  • Posts: 364
Joined: Jul 13, 2011
October 4th, 2016 at 10:26:01 AM permalink
Quote: ThatDonGuy

...mainly because Microsoft's implementation of lists doesn't seem to be very efficient when doing searches (for duplicate hands).



That's one of the perks of clojure. The Maps (and vectors for that matter) are stored, under the hood, in the form of a tree with 32 branches per node. You never have to to more than 7 (8?) tests to get to the bottom.
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6691
Joined: Jun 22, 2011
October 5th, 2016 at 7:01:24 AM permalink
Quote: MathExtremist

It should be much faster to process the list and turn it into a new map: for each item in the initial list of all hands, do an add-or-increment to a new map or dictionary from canonical hand to integer. That way you end up with the new map containing unique entries for each hand and a count of how many times each occurred. The list size is 6009159 and the sum of the counts is 133784560.


If I am reading your description correctly, then maybe it's me, or maybe it's the .NET libraries, but your method takes almost twice as long.

Let me make sure I am comparing the two methods correctly.
The way I am implementing yours is:
For each of the 133,784,560 sets of seven distinct integers in {0, 1, ..., 51}:
> > Convert each to a 52-bit key value
> > If the key is not in the dictionary of hands, add it, with an initial value of 0
> > > Increment the key's dictionary value by 1
When finished, there are 6,009,159 entries, and the sum of the counts is 133,784,560

Mine is:
For each of the 133,784,560 sets of seven distinct integers in {0, 1, ..., 51}:
> > Convert each to a 52-bit key value
> > Add it to a list
When finished, sort the list
Create another list, each entry of which contains a key and a count
Set the "current key" to the first value in the sorted list, and the "current count" to 1
For each entry in the sorted list starting with the second one:
> > If it does not match the "current key":
> > > Create an entry for the new list, with key = "current key" and value = "current count"
> > > Set current key = the sorted list entry's key and current count = 0
> > Increment current count
Create an entry for the new list, with key = "current key" and value = "current count" (this is for the final key in the sorted list)
When finished, the second list also has 6,009,159 entries, and the sum of the counts is also 133,784,560

The first method takes about 50 seconds; the second takes about 30.
For all I know, it could be because of the way .NET implements dictionary searches.
  • Jump to: