示例#1
0
文件: Program.cs 项目: sev-it/asp.net
 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();
 }
示例#2
0
 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++));
         }
     }
 }
示例#3
0
文件: Program.cs 项目: sev-it/asp.net
 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();
 }
示例#4
0
文件: Deck.cs 项目: aphim/Durak-Game
 /// <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();
         }
     }
 }