Skip to content

Instantly share code, notes, and snippets.

@spetroll
Last active December 10, 2015 09:18
Show Gist options
  • Save spetroll/4413201 to your computer and use it in GitHub Desktop.
Save spetroll/4413201 to your computer and use it in GitHub Desktop.
public static long encode(IEnumerable<int> cards)
{
long result = 0;
foreach(int c in cards)
{
result |= encode(new Card(c));
}
return result;
}
public static long encode(Card c)
{
return 0x1L << ((int) c.Suit*16 + (int) c.Rank);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment