Advertisement
monstrasitix

52 Cards

May 7th, 2015
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.13 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Cards2
  8. {
  9.     class Program
  10.     {
  11.         // Main method
  12.         static void Main(string[] args)
  13.         {
  14.             string[] values = { "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K" };
  15.             byte[] suits = { 3, 5, 4, 6 };
  16.  
  17.             Console.WriteLine("\n\n");
  18.  
  19.             for (int j = 0; j < suits.Length; j++)
  20.             {
  21.                 Console.Write("\t");
  22.  
  23.                 for (int i = 0; i < values.Length; i++)
  24.                 {
  25.                     if (suits[j] == 5 || suits[j] == 6) Console.ForegroundColor = ConsoleColor.Black;
  26.                     else Console.ForegroundColor = ConsoleColor.Red;
  27.                     Console.BackgroundColor = ConsoleColor.White;
  28.  
  29.                     Console.Write("|{0}{1}|", values[i], (char)suits[j]);
  30.  
  31.                     Console.ResetColor();
  32.                     Console.Write(" ");
  33.                 }
  34.  
  35.                 Console.WriteLine("\n");
  36.             }
  37.  
  38.             Console.ReadKey();
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement