public static float Calculate(CardSet board) { CalulateParam param = new CalulateParam(); int boardSize = board.CountCards(); int toDeal = 7 - boardSize; CardEnum.Combin(StdDeck.Descriptor, toDeal, board, CardSet.Empty, OnDeal, param); return((float)(param.Sum / EnumAlgos.CountCombin(52 - boardSize, toDeal))); }
static void OnDeal(ref CardSet hand, CalulateParam p) { p.Sum += HandValueToOrdinal.GetOrdinal7(CardSetEvaluator.Evaluate(ref hand)); }