private static void Main(string[] args) { MyCopyableClass myObj = new MyCopyableClass(); Console.WriteLine("myObj: {0}", myObj.myNumber); MyCopyableClass myCopy = myObj.GetCopy(); Console.WriteLine("myCopy: {0}", myCopy.myNumber); myObj.myNumber = 6; Console.WriteLine("myObj: {0}\nmyCopy: {1}", myObj.myNumber, myCopy.myNumber); /// <summary> /// Клиенсткое приложение для Ch10CardLib /// </summary> Deck myDeck = new Deck(); myDeck.Shuffle(); bool Result = true; for (int count = 1; count < 52; count ++) { if (count%5 == 0) { if (Result) Console.WriteLine("Flash!s"); else { Console.WriteLine("Not flash!"); } Result = true; } Result = Result & myDeck.GetCard(count - 1).suit == myDeck.GetCard(count).suit; } Console.ReadKey(); }
private void DealHands() { for (int p = 0; p < players.Length; p++) { for (int c = 0; c < 7; c++) { players[p].PlayHand.Add(playDeck.GetCard(currentCard++)); } } }
static void Main(string[] args) { Deck myDeck = new Deck(); myDeck.Shuffle(); for (int i = 0; i < 52; i++) { Console.Write(myDeck.GetCard(i).ToString()); if (i != 51) Console.Write(", "); else Console.WriteLine(); } Console.ReadKey(); }
/// <summary> /// Display deck method used to display the remaining deck /// </summary> /// <param name="myDeck"></param> public void displayDeck(Deck myDeck) { //loops through the length of the deck for (int i = 0; i < myDeck.getCardsRemaining(); i++) { //displays the current card Card tempCard = myDeck.GetCard(i); Console.Write(tempCard.ToString()); if (i != myDeck.getCardsRemaining() - 1) { Console.Write(", "); } else { Console.WriteLine(); } } }