private static void GiveMeTheBestHand(Deck deck, ICardPrinter cardPrinter) { BigInteger counter = 0; Hand currentHand; deck.Reset(); deck.Shuffle(); do { counter++; if (deck.NumberOfCards < 5) { deck.Reset(); deck.Shuffle(); } currentHand = deck.TakeOneHand(); //Console.WriteLine(deck.NumberOfCards); if (counter%1000 == 0) Console.WriteLine(counter); } while (!CheckIfIsTargetHand(currentHand)); Console.WriteLine("I needed {0} times", counter); cardPrinter.Print(currentHand.ShowCard()); }
private static void Shuffle(Deck deck) { deck.Shuffle(); Console.WriteLine("Your deck is shuffled"); }